Skip to content

Commit 20d958a

Browse files
committed
Add strict QT mode to tests
1 parent f84e22f commit 20d958a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/napari_matplotlib/tests/conftest.py

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import numpy as np
24
import pytest
35
from skimage import data
@@ -17,3 +19,17 @@ def image_data(request):
1719
@pytest.fixture
1820
def astronaut_data():
1921
return data.astronaut(), {"rgb": True}
22+
23+
24+
@pytest.fixture(autouse=True, scope="session")
25+
def set_strict_qt():
26+
env_var = "NAPARI_STRICT_QT"
27+
old_val = os.environ.get(env_var)
28+
os.environ[env_var] = "1"
29+
# Run tests
30+
yield
31+
# Reset to original value
32+
if old_val is not None:
33+
os.environ[env_var] = old_val
34+
else:
35+
del os.environ[env_var]

0 commit comments

Comments
 (0)