File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed
napari_cellseg_annotator/_tests Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 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" )
Original file line number Diff line number Diff line change 11from 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" )
Original file line number Diff line number Diff line change 11from napari_cellseg_annotator import utils
22import 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 )
You can’t perform that action at this time.
0 commit comments