Skip to content

Commit b544023

Browse files
committed
lint
1 parent 5bf6c6a commit b544023

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pytest
2+
import os
3+
4+
5+
@pytest.fixture(scope="session", autouse=True)
6+
def env_config():
7+
"""
8+
Configure environment variables needed for the test session
9+
"""
10+
11+
# This makes QT render everything offscreen and thus prevents
12+
# any Modals / Dialogs or other Widgets being rendered on the screen while running unit tests
13+
os.environ["QT_QPA_PLATFORM"] = "offscreen"
14+
15+
yield
16+
17+
os.environ.pop("QT_QPA_PLATFORM")
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from napari_cellseg_annotator.plugin_loader import Loader
2+
import os
23

34

4-
def test_loader(make_napari_viewer) :
5+
def test_loader(make_napari_viewer):
56
viewer = make_napari_viewer()
67
widget = Loader(viewer)
7-
widget.show_dialog_mod()
8+
widget.opath = os.path.join(os.path.dirname(__file__), "test_res")
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from napari_cellseg_annotator import utils
22
import numpy as np
33

4-
def test_normalize_x() :
54

6-
test_array = utils.normalize_x(np.array([0,255,127.5]))
7-
expected = np.array([-1,1, 0])
8-
assert np.all(test_array == expected)
5+
def test_normalize_x():
96

7+
test_array = utils.normalize_x(np.array([0, 255, 127.5]))
8+
expected = np.array([-1, 1, 0])
9+
assert np.all(test_array == expected)

0 commit comments

Comments
 (0)