Skip to content

Commit c2f9063

Browse files
committed
Add strict QT mode to tests
1 parent e8c276c commit c2f9063

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/napari_matplotlib/tests/conftest.py

Lines changed: 16 additions & 0 deletions
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
@@ -22,3 +24,17 @@ def astronaut_data():
2224
@pytest.fixture
2325
def brain_data():
2426
return data.brain(), {"rgb": False}
27+
28+
29+
@pytest.fixture(autouse=True, scope="session")
30+
def set_strict_qt():
31+
env_var = "NAPARI_STRICT_QT"
32+
old_val = os.environ.get(env_var)
33+
os.environ[env_var] = "1"
34+
# Run tests
35+
yield
36+
# Reset to original value
37+
if old_val is not None:
38+
os.environ[env_var] = old_val
39+
else:
40+
del os.environ[env_var]

0 commit comments

Comments
 (0)