Skip to content

Commit aa44cc5

Browse files
committed
make dandi tests lazy as well
1 parent 659c281 commit aa44cc5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_inspector.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121
from nwbinspector.nwbinspector import inspect_all, inspect_nwb
2222
from nwbinspector.register_checks import Severity, InspectorMessage, register_check
23-
from nwbinspector.utils import FilePathType
23+
from nwbinspector.utils import FilePathType, is_module_installed
2424
from nwbinspector.tools import make_minimal_nwbfile
2525

2626

@@ -35,6 +35,7 @@
3535
HAVE_ROS3 = True
3636
except ValueError: # ValueError: h5py was built without ROS3 support, can't use ros3 driver
3737
HAVE_ROS3 = False
38+
HAVE_DANDI = is_module_installed("dandi")
3839

3940

4041
def add_big_dataset_no_compression(nwbfile: NWBFile):
@@ -472,7 +473,7 @@ def test_inspect_nwb_manual_iteration_stop(self):
472473
next(generator)
473474

474475

475-
@pytest.mark.skipif(not HAVE_ROS3, reason="Needs h5py setup with ROS3.")
476+
@pytest.mark.skipif(not HAVE_ROS3 or not HAVE_DANDI, reason="Needs h5py setup with ROS3.")
476477
def test_dandiset_streaming():
477478
messages = list(inspect_all(path="000126", select=["check_subject_species_exists"], stream=True))
478479
assert messages[0] == InspectorMessage(
@@ -486,7 +487,7 @@ def test_dandiset_streaming():
486487
)
487488

488489

489-
@pytest.mark.skipif(not HAVE_ROS3, reason="Needs h5py setup with ROS3.")
490+
@pytest.mark.skipif(not HAVE_ROS3 or not HAVE_DANDI, reason="Needs h5py setup with ROS3.")
490491
def test_dandiset_streaming_parallel():
491492
messages = list(inspect_all(path="000126", select=["check_subject_species_exists"], stream=True, n_jobs=2))
492493
assert messages[0] == InspectorMessage(
@@ -500,7 +501,7 @@ def test_dandiset_streaming_parallel():
500501
)
501502

502503

503-
@pytest.mark.skipif(not HAVE_ROS3, reason="Needs h5py setup with ROS3.")
504+
@pytest.mark.skipif(not HAVE_ROS3 or not HAVE_DANDI, reason="Needs h5py setup with ROS3.")
504505
class TestStreamingCLI(TestCase):
505506
@classmethod
506507
def setUpClass(cls):

0 commit comments

Comments
 (0)