Skip to content

Run Qt tests offscreen so they don't open windows - #573

Merged
gbeane merged 1 commit into
mainfrom
fix/offscreen-qt-tests
Nov 5, 2026
Merged

gbeane merged 1 commit into
mainfrom
fix/offscreen-qt-tests

Conversation

@gbeane

@gbeane gbeane commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

UI tests that call `.show()` (e.g. `test_progress_dialog.py`, `test_frame_ruler_widget.py`) opened real windows locally and stole focus.

  • Add `tests/conftest.py` that defaults `QT_QPA_PLATFORM` to `offscreen` (via `setdefault`, so `QT_QPA_PLATFORM=cocoa` still shows the widgets when wanted).
  • `test_parameter_spinbox_is_sized_for_display_maximum` now allows a 1px difference: the size hint subtracts two text widths that Qt rounds to whole pixels, and the offscreen platform's font metrics left it 1px off the reference.

@gbeane
gbeane merged commit 7a5637d into main Nov 5, 2026
5 checks passed
@gbeane
gbeane deleted the fix/offscreen-qt-tests branch November 5, 2026 19:20
@gbeane gbeane mentioned this pull request Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant