Skip to content

Commit fde2382

Browse files
author
Luca Marconato
committed
fix skip tests if napari offscreen
1 parent 77c08bf commit fde2382

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/test_interactive.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919

2020

21-
@pytest.mark.skipif(not OFFSCREEN, reason="Not running in offscreen mode")
21+
@pytest.mark.skipif(OFFSCREEN, reason="Not running in offscreen mode")
2222
@pytest.mark.usefixtures("mock_app_model")
2323
class TestImages(PlotTester, metaclass=PlotTesterMeta):
2424
def test_plot_can_add_element_image(self, sdata_blobs: SpatialData):
@@ -53,7 +53,7 @@ def test_switch_coordinate_system(self, sdata_blobs: SpatialData):
5353
Viewer.close_all()
5454

5555

56-
@pytest.mark.skipif(not OFFSCREEN, reason="Not running in offscreen mode")
56+
@pytest.mark.skipif(OFFSCREEN, reason="Not running in offscreen mode")
5757
@pytest.mark.usefixtures("mock_app_model")
5858
def test_plot_can_add_element_switch_cs(sdata_blobs: SpatialData):
5959
i = Interactive(sdata=sdata_blobs, headless=True)
@@ -63,7 +63,7 @@ def test_plot_can_add_element_switch_cs(sdata_blobs: SpatialData):
6363
Viewer.close_all()
6464

6565

66-
@pytest.mark.skipif(not OFFSCREEN, reason="Not running in offscreen mode")
66+
@pytest.mark.skipif(OFFSCREEN, reason="Not running in offscreen mode")
6767
@pytest.mark.usefixtures("mock_app_model")
6868
class TestInteractive(PlotTester, metaclass=PlotTesterMeta):
6969
def test_get_layer_existing(self, sdata_blobs: SpatialData):
@@ -94,7 +94,7 @@ def test_add_text_to_polygons(self, sdata_blobs: SpatialData):
9494
Viewer.close_all()
9595

9696

97-
@pytest.mark.skipif(not OFFSCREEN, reason="Not running in offscreen mode")
97+
@pytest.mark.skipif(OFFSCREEN, reason="Not running in offscreen mode")
9898
@pytest.mark.skipif(ARM_PROBLEM, reason="Test will segfault on ARM with numpy < 2")
9999
@pytest.mark.use_thread_loader
100100
def test_load_data_in_thread(make_napari_viewer: Callable[[], Viewer], sdata_blobs: SpatialData, qtbot: QtBot) -> None:

tests/test_spatialdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_sdatawidget_labels(qtbot, make_napari_viewer: Any, blobs_extra_cs: Spat
9595
assert widget.viewer_model.viewer.layers[0].metadata.get("region_key") is not None
9696

9797

98-
@pytest.mark.skipif(not OFFSCREEN, reason="Not running in offscreen mode")
98+
@pytest.mark.skipif(OFFSCREEN, reason="Not running in offscreen mode")
9999
def test_sdatawidget_points(caplog, make_napari_viewer: Any, blobs_extra_cs: SpatialData):
100100
config.POINT_THRESHOLD = 400
101101
blobs_extra_cs.points["many_points"] = PointsModel.parse(

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_min_max_norm(vec: np.ndarray) -> None:
8585
assert (out.min(), out.max()) == (0, 1)
8686

8787

88-
@pytest.mark.skipif(not OFFSCREEN, reason="Not running in offscreen mode")
88+
@pytest.mark.skipif(OFFSCREEN, reason="Not running in offscreen mode")
8989
def test_logger(caplog, prepare_continuous_test_data, adata_labels: AnnData, make_napari_viewer: Any):
9090
from napari_spatialdata._model import DataModel
9191
from napari_spatialdata._scatterwidgets import PlotWidget

0 commit comments

Comments
 (0)