From 9eb82ba7b389b52356ce1d7fd264ee7e991e5c52 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 6 Aug 2024 09:34:34 -0300 Subject: [PATCH 1/2] test general skip --- .../extractors/tests/test_iblextractors.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/spikeinterface/extractors/tests/test_iblextractors.py b/src/spikeinterface/extractors/tests/test_iblextractors.py index c7c2dfacae..70d371a015 100644 --- a/src/spikeinterface/extractors/tests/test_iblextractors.py +++ b/src/spikeinterface/extractors/tests/test_iblextractors.py @@ -19,12 +19,15 @@ def setUpClass(cls): from one.api import ONE cls.eid = EID - cls.one = ONE( - base_url="https://openalyx.internationalbrainlab.org", - password="international", - silent=True, - cache_dir=None, - ) + try: + cls.one = ONE( + base_url="https://openalyx.internationalbrainlab.org", + password="international", + silent=True, + cache_dir=None, + ) + except: + pytest.skip("Skipping test due to server being down.") try: cls.recording = read_ibl_recording(eid=cls.eid, stream_name="probe00.ap", one=cls.one) except requests.exceptions.HTTPError as e: From 21cc1b6c4a3a57f6f3ef324a415dae88eec4bf2c Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 6 Aug 2024 09:47:11 -0300 Subject: [PATCH 2/2] add skip to the rest of the tests --- .../extractors/tests/test_iblextractors.py | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/spikeinterface/extractors/tests/test_iblextractors.py b/src/spikeinterface/extractors/tests/test_iblextractors.py index 70d371a015..c79627bb59 100644 --- a/src/spikeinterface/extractors/tests/test_iblextractors.py +++ b/src/spikeinterface/extractors/tests/test_iblextractors.py @@ -112,12 +112,15 @@ def setUpClass(cls): from one.api import ONE cls.eid = "e2b845a1-e313-4a08-bc61-a5f662ed295e" - cls.one = ONE( - base_url="https://openalyx.internationalbrainlab.org", - password="international", - silent=True, - cache_dir=None, - ) + try: + cls.one = ONE( + base_url="https://openalyx.internationalbrainlab.org", + password="international", + silent=True, + cache_dir=None, + ) + except: + pytest.skip("Skipping test due to server being down.") cls.recording = read_ibl_recording(eid=cls.eid, stream_name="probe00.ap", load_sync_channel=True, one=cls.one) cls.small_scaled_trace = cls.recording.get_traces(start_frame=5, end_frame=26, return_scaled=True) cls.small_unscaled_trace = cls.recording.get_traces( @@ -185,12 +188,15 @@ def test_ibl_sorting_extractor(self): """ from one.api import ONE - one = ONE( - base_url="https://openalyx.internationalbrainlab.org", - password="international", - silent=True, - cache_dir=None, - ) + try: + one = ONE( + base_url="https://openalyx.internationalbrainlab.org", + password="international", + silent=True, + cache_dir=None, + ) + except: + pytest.skip("Skipping test due to server being down.") sorting = read_ibl_sorting(pid=PID, one=one) assert len(sorting.unit_ids) == 733 sorting_good = read_ibl_sorting(pid=PID, good_clusters_only=True)