2020)
2121from nwbinspector .nwbinspector import inspect_all , inspect_nwb
2222from nwbinspector .register_checks import Severity , InspectorMessage , register_check
23- from nwbinspector .utils import FilePathType
23+ from nwbinspector .utils import FilePathType , is_module_installed
2424from nwbinspector .tools import make_minimal_nwbfile
2525
2626
3535 HAVE_ROS3 = True
3636except 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
4041def 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." )
476477def 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." )
490491def 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." )
504505class TestStreamingCLI (TestCase ):
505506 @classmethod
506507 def setUpClass (cls ):
0 commit comments