From 6a3364ba148ce499abe1ead86062bc8447c3fdf4 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Thu, 28 May 2026 10:10:48 +0200 Subject: [PATCH] fix: sv curation tests --- .../curation/tests/test_sortingview_curation.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/spikeinterface/curation/tests/test_sortingview_curation.py b/src/spikeinterface/curation/tests/test_sortingview_curation.py index f712f39f5f..9b1305205a 100644 --- a/src/spikeinterface/curation/tests/test_sortingview_curation.py +++ b/src/spikeinterface/curation/tests/test_sortingview_curation.py @@ -1,7 +1,7 @@ import pytest from pathlib import Path import os -import json +import importlib.util import numpy as np import spikeinterface as si @@ -20,6 +20,15 @@ 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.