1111from spatialdata .models import Image2DModel
1212
1313from napari_spatialdata ._interactive import Interactive
14- from tests .conftest import PlotTester , PlotTesterMeta
14+ from tests .conftest import OFFSCREEN , PlotTester , PlotTesterMeta
1515
1616ARM_PROBLEM = (
1717 parse_version (version ("numpy" )) < parse_version ("2" ) and sys .platform == "darwin" and platform .machine () == "arm64"
1818)
1919
2020
21+ @pytest .mark .skipif (OFFSCREEN , reason = "Not running in offscreen mode" )
2122@pytest .mark .usefixtures ("mock_app_model" )
2223class TestImages (PlotTester , metaclass = PlotTesterMeta ):
2324 def test_plot_can_add_element_image (self , sdata_blobs : SpatialData ):
@@ -52,6 +53,7 @@ def test_switch_coordinate_system(self, sdata_blobs: SpatialData):
5253 Viewer .close_all ()
5354
5455
56+ @pytest .mark .skipif (OFFSCREEN , reason = "Not running in offscreen mode" )
5557@pytest .mark .usefixtures ("mock_app_model" )
5658def test_plot_can_add_element_switch_cs (sdata_blobs : SpatialData ):
5759 i = Interactive (sdata = sdata_blobs , headless = True )
@@ -61,6 +63,7 @@ def test_plot_can_add_element_switch_cs(sdata_blobs: SpatialData):
6163 Viewer .close_all ()
6264
6365
66+ @pytest .mark .skipif (OFFSCREEN , reason = "Not running in offscreen mode" )
6467@pytest .mark .usefixtures ("mock_app_model" )
6568class TestInteractive (PlotTester , metaclass = PlotTesterMeta ):
6669 def test_get_layer_existing (self , sdata_blobs : SpatialData ):
@@ -91,6 +94,7 @@ def test_add_text_to_polygons(self, sdata_blobs: SpatialData):
9194 Viewer .close_all ()
9295
9396
97+ @pytest .mark .skipif (OFFSCREEN , reason = "Not running in offscreen mode" )
9498@pytest .mark .skipif (ARM_PROBLEM , reason = "Test will segfault on ARM with numpy < 2" )
9599@pytest .mark .use_thread_loader
96100def test_load_data_in_thread (make_napari_viewer : Callable [[], Viewer ], sdata_blobs : SpatialData , qtbot : QtBot ) -> None :
0 commit comments