diff --git a/tests/widgets/test_widget_open_file.py b/tests/widgets/test_widget_open_file.py index 7a7cb5e9..60533315 100644 --- a/tests/widgets/test_widget_open_file.py +++ b/tests/widgets/test_widget_open_file.py @@ -1,11 +1,17 @@ +import os + import napari import numpy as np +import pytest from plantseg.io.h5 import create_h5 from plantseg.io.voxelsize import VoxelSize from plantseg.viewer_napari.widgets.io import PathMode, widget_open_file +IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" # set to true in GitHub Actions by default to skip CUDA tests + +@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="GUI tests hangs in GitHub Actions.") def test_widget_open_file(make_napari_viewer_proxy, path_h5): print("test_widget_open_file called") viewer = make_napari_viewer_proxy() diff --git a/tests/widgets/test_widget_preprocessing.py b/tests/widgets/test_widget_preprocessing.py index 6b1f8411..0173563e 100644 --- a/tests/widgets/test_widget_preprocessing.py +++ b/tests/widgets/test_widget_preprocessing.py @@ -1,3 +1,5 @@ +import os + import napari import numpy as np import pytest @@ -8,6 +10,8 @@ from plantseg.io.voxelsize import VoxelSize from plantseg.viewer_napari.widgets.dataprocessing import RescaleModes, widget_rescaling +IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" # set to true in GitHub Actions by default to skip CUDA tests + def create_layer_name(name: str, suffix: str): return f"{name}_{suffix}" @@ -47,6 +51,7 @@ def widget_add_image(image: PlantSegImage) -> LayerDataTuple: return image.to_napari_layer_tuple() +@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="GUI tests hangs in GitHub Actions.") class TestWidgetRescaling: def test_rescaling_from_factor(self, make_napari_viewer_proxy, sample_image): viewer = make_napari_viewer_proxy()