diff --git a/src/spikeinterface/curation/tests/test_sortingview_curation.py b/src/spikeinterface/curation/tests/test_sortingview_curation.py index f712f39f5f..d7d2a5cc5c 100644 --- a/src/spikeinterface/curation/tests/test_sortingview_curation.py +++ b/src/spikeinterface/curation/tests/test_sortingview_curation.py @@ -3,6 +3,7 @@ import os import json import numpy as np +import importlib.util import spikeinterface as si from spikeinterface.core import generate_sorting @@ -20,6 +21,14 @@ ON_GITHUB = bool(os.getenv("GITHUB_ACTIONS")) KACHERY_CLOUD_SET = bool(os.getenv("KACHERY_API_KEY")) +kachery_spec = importlib.util.find_spec("kachery") +if kachery_spec is not None: + HAVE_KACHERY = True +else: + HAVE_KACHERY = False + + +SKIP_KACHERY_REMOTE = not HAVE_KACHERY or (ON_GITHUB and not KACHERY_CLOUD_SET) # this needs to be run only once: if we want to regenerate we need to start with sorting result # TODO : regenerate the @@ -43,7 +52,7 @@ # # https://figurl.org/f?v=npm://@fi-sci/figurl-sortingview@12/dist&d=sha1://058ab901610aa9d29df565595a3cc2a81a1b08e5 -@pytest.mark.skipif(ON_GITHUB and not KACHERY_CLOUD_SET, reason="Kachery cloud secrets not available") +@pytest.mark.skipif(SKIP_KACHERY_REMOTE, reason="Kachery cloud secrets not available") def test_gh_curation(): """ Test curation using GitHub URI. @@ -73,7 +82,7 @@ def test_gh_curation(): assert len(sorting_curated_gh_art_mua.unit_ids) == 5 -@pytest.mark.skipif(ON_GITHUB and not KACHERY_CLOUD_SET, reason="Kachery cloud secrets not available") +@pytest.mark.skipif(SKIP_KACHERY_REMOTE, reason="Kachery cloud secrets not available") def test_sha1_curation(): """ Test curation using SHA1 URI.