Skip to content

Commit

Permalink
Run tests offscreen on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Oct 19, 2023
1 parent 330a610 commit cca7fc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,15 @@ def mock_connect(monkeypatch):

@pytest.fixture(scope="session", autouse=True)
def hide_window(request):
if sys.platform == "darwin" or request.config.getoption("--show-gui"):
if request.config.getoption("--show-gui"):
yield
return

old_value = os.environ.get("QT_QPA_PLATFORM")
os.environ["QT_QPA_PLATFORM"] = "minimal"
if sys.platform == "darwin":
os.environ["QT_QPA_PLATFORM"] = "offscreen"
else:
os.environ["QT_QPA_PLATFORM"] = "minimal"
yield
if old_value is None:
del os.environ["QT_QPA_PLATFORM"]
Expand Down

0 comments on commit cca7fc8

Please sign in to comment.