Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Shared test configuration for the application test suite."""

import os

# Render Qt widgets offscreen so UI tests don't open windows and steal focus. Set before
# any test module creates a QApplication; override with e.g. QT_QPA_PLATFORM=cocoa to
# watch the widgets.
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
4 changes: 3 additions & 1 deletion tests/ui/test_postprocessing_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ def test_parameter_spinbox_is_sized_for_display_maximum() -> None:
full_range_reference.setRange(1, _INT_MAX)

width = spinbox.sizeHint().width()
assert width == display_reference.sizeHint().width()
# the hint subtracts two text widths that Qt rounds to whole pixels, so it can land
# one pixel off the reference
assert abs(width - display_reference.sizeHint().width()) <= 1
assert width < full_range_reference.sizeHint().width()


Expand Down
Loading