Skip to content

Commit

Permalink
monkeypatch torch mps on CI to be False because runners dont have it
Browse files Browse the repository at this point in the history
  • Loading branch information
psobolewskiPhD committed Sep 14, 2024
1 parent d26dc08 commit d34c62d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

SAMPLE = Path(__file__).parent / "sample.tif"

@pytest.fixture(autouse=True)
def patch_mps_on_CI(monkeypatch):
# https://github.com/actions/runner-images/issues/9918
if os.getenv('CI'):
monkeypatch.setattr("torch.backends.mps.is_available", lambda: False)


@pytest.fixture
def viewer_widget(make_napari_viewer: Callable[..., napari.Viewer]):
viewer = make_napari_viewer()
Expand Down

0 comments on commit d34c62d

Please sign in to comment.