Skip to content

Commit 6a3364b

Browse files
committed
fix: sv curation tests
1 parent 7ec0102 commit 6a3364b

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/spikeinterface/curation/tests/test_sortingview_curation.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
from pathlib import Path
33
import os
4-
import json
4+
import importlib.util
55
import numpy as np
66

77
import spikeinterface as si
@@ -20,6 +20,15 @@
2020
ON_GITHUB = bool(os.getenv("GITHUB_ACTIONS"))
2121
KACHERY_CLOUD_SET = bool(os.getenv("KACHERY_API_KEY"))
2222

23+
kachery_spec = importlib.util.find_spec("kachery")
24+
if kachery_spec is not None:
25+
HAVE_KACHERY = True
26+
else:
27+
HAVE_KACHERY = False
28+
29+
30+
SKIP_KACHERY_REMOTE = not HAVE_KACHERY or (ON_GITHUB and not KACHERY_CLOUD_SET)
31+
2332

2433
# this needs to be run only once: if we want to regenerate we need to start with sorting result
2534
# TODO : regenerate the
@@ -43,7 +52,7 @@
4352
# # https://figurl.org/f?v=npm://@fi-sci/figurl-sortingview@12/dist&d=sha1://058ab901610aa9d29df565595a3cc2a81a1b08e5
4453

4554

46-
@pytest.mark.skipif(ON_GITHUB and not KACHERY_CLOUD_SET, reason="Kachery cloud secrets not available")
55+
@pytest.mark.skipif(SKIP_KACHERY_REMOTE, reason="Kachery cloud secrets not available")
4756
def test_gh_curation():
4857
"""
4958
Test curation using GitHub URI.
@@ -73,7 +82,7 @@ def test_gh_curation():
7382
assert len(sorting_curated_gh_art_mua.unit_ids) == 5
7483

7584

76-
@pytest.mark.skipif(ON_GITHUB and not KACHERY_CLOUD_SET, reason="Kachery cloud secrets not available")
85+
@pytest.mark.skipif(SKIP_KACHERY_REMOTE, reason="Kachery cloud secrets not available")
7786
def test_sha1_curation():
7887
"""
7988
Test curation using SHA1 URI.

0 commit comments

Comments
 (0)