diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a8ef737..5fe29befe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Improvements * Using ruff to enforce existence of public classes' docstrings [PR #1034](https://github.com/catalystneuro/neuroconv/pull/1034) +* Separated tests that use external data by modality [PR #1049](https://github.com/catalystneuro/neuroconv/pull/1049) ## v0.6.1 (August 30, 2024) diff --git a/docs/conversion_examples_gallery/fiberphotometry/tdt_fp.rst b/docs/conversion_examples_gallery/fiberphotometry/tdt_fp.rst index 7d6ebd48c..b82e4a801 100644 --- a/docs/conversion_examples_gallery/fiberphotometry/tdt_fp.rst +++ b/docs/conversion_examples_gallery/fiberphotometry/tdt_fp.rst @@ -205,7 +205,7 @@ Convert TDT Fiber Photometry data to NWB using >>> folder_path = OPHYS_DATA_PATH / "fiber_photometry_datasets" / "TDT" / "Photo_249_391-200721-120136_stubbed" >>> LOCAL_PATH = Path(".") # Path to neuroconv - >>> editable_metadata_path = LOCAL_PATH / "tests" / "test_on_data" / "fiber_photometry_metadata.yaml" + >>> editable_metadata_path = LOCAL_PATH / "tests" / "test_on_data" / "ophys" / "fiber_photometry_metadata.yaml" >>> interface = TDTFiberPhotometryInterface(folder_path=folder_path, verbose=True) >>> metadata = interface.get_metadata() diff --git a/tests/test_internals/test_schemas.py b/tests/test_minimal/test_schemas.py similarity index 100% rename from tests/test_internals/test_schemas.py rename to tests/test_minimal/test_schemas.py diff --git a/tests/test_internals/__init__.py b/tests/test_on_data/behavior/__init__.py similarity index 100% rename from tests/test_internals/__init__.py rename to tests/test_on_data/behavior/__init__.py diff --git a/tests/test_on_data/test_behavior_interfaces.py b/tests/test_on_data/behavior/test_behavior_interfaces.py similarity index 99% rename from tests/test_on_data/test_behavior_interfaces.py rename to tests/test_on_data/behavior/test_behavior_interfaces.py index 33d0d468b..2ec43f96e 100644 --- a/tests/test_on_data/test_behavior_interfaces.py +++ b/tests/test_on_data/behavior/test_behavior_interfaces.py @@ -37,7 +37,7 @@ from neuroconv.utils import DeepDict try: - from .setup_paths import BEHAVIOR_DATA_PATH, OPHYS_DATA_PATH, OUTPUT_PATH + from ..setup_paths import BEHAVIOR_DATA_PATH, OPHYS_DATA_PATH, OUTPUT_PATH except ImportError: from setup_paths import BEHAVIOR_DATA_PATH, OUTPUT_PATH diff --git a/tests/test_on_data/test_format_converters/test_lightningpose_converter.py b/tests/test_on_data/behavior/test_lightningpose_converter.py similarity index 100% rename from tests/test_on_data/test_format_converters/test_lightningpose_converter.py rename to tests/test_on_data/behavior/test_lightningpose_converter.py diff --git a/tests/test_on_data/test_format_converters/__init__.py b/tests/test_on_data/ecephys/__init__.py similarity index 100% rename from tests/test_on_data/test_format_converters/__init__.py rename to tests/test_on_data/ecephys/__init__.py diff --git a/tests/test_on_data/test_format_converters/spikeglx_multi_probe_metadata.json b/tests/test_on_data/ecephys/spikeglx_multi_probe_metadata.json similarity index 100% rename from tests/test_on_data/test_format_converters/spikeglx_multi_probe_metadata.json rename to tests/test_on_data/ecephys/spikeglx_multi_probe_metadata.json diff --git a/tests/test_on_data/test_format_converters/spikeglx_single_probe_metadata.json b/tests/test_on_data/ecephys/spikeglx_single_probe_metadata.json similarity index 100% rename from tests/test_on_data/test_format_converters/spikeglx_single_probe_metadata.json rename to tests/test_on_data/ecephys/spikeglx_single_probe_metadata.json diff --git a/tests/test_on_data/test_gin_ecephys/test_aux_interfaces.py b/tests/test_on_data/ecephys/test_aux_interfaces.py similarity index 100% rename from tests/test_on_data/test_gin_ecephys/test_aux_interfaces.py rename to tests/test_on_data/ecephys/test_aux_interfaces.py diff --git a/tests/test_on_data/test_gin_ecephys/test_lfp.py b/tests/test_on_data/ecephys/test_lfp.py similarity index 100% rename from tests/test_on_data/test_gin_ecephys/test_lfp.py rename to tests/test_on_data/ecephys/test_lfp.py diff --git a/tests/test_on_data/test_gin_ecephys/test_openephyslegacy.py b/tests/test_on_data/ecephys/test_openephyslegacy.py similarity index 100% rename from tests/test_on_data/test_gin_ecephys/test_openephyslegacy.py rename to tests/test_on_data/ecephys/test_openephyslegacy.py diff --git a/tests/test_on_data/test_metadata/test_plexon_metadata.py b/tests/test_on_data/ecephys/test_plexon_metadata.py similarity index 100% rename from tests/test_on_data/test_metadata/test_plexon_metadata.py rename to tests/test_on_data/ecephys/test_plexon_metadata.py diff --git a/tests/test_on_data/test_gin_ecephys/test_raw_recordings.py b/tests/test_on_data/ecephys/test_raw_recordings.py similarity index 98% rename from tests/test_on_data/test_gin_ecephys/test_raw_recordings.py rename to tests/test_on_data/ecephys/test_raw_recordings.py index 7388845cc..97ca75976 100644 --- a/tests/test_on_data/test_gin_ecephys/test_raw_recordings.py +++ b/tests/test_on_data/ecephys/test_raw_recordings.py @@ -19,8 +19,8 @@ from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH from ..setup_paths import OUTPUT_PATH except ImportError: - from setup_paths import ECEPHY_DATA_PATH as DATA_PATH - from setup_paths import OUTPUT_PATH + from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH + from ..setup_paths import OUTPUT_PATH if not DATA_PATH.exists(): pytest.fail(f"No folder found in location: {DATA_PATH}!") diff --git a/tests/test_on_data/test_recording_interfaces.py b/tests/test_on_data/ecephys/test_recording_interfaces.py similarity index 99% rename from tests/test_on_data/test_recording_interfaces.py rename to tests/test_on_data/ecephys/test_recording_interfaces.py index 14b8e87ea..66e6f2b7b 100644 --- a/tests/test_on_data/test_recording_interfaces.py +++ b/tests/test_on_data/ecephys/test_recording_interfaces.py @@ -37,9 +37,9 @@ ) try: - from .setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH + from ..setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH except ImportError: - from setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH + from ..setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH this_python_version = version.parse(python_version()) diff --git a/tests/test_on_data/test_sorting_interfaces.py b/tests/test_on_data/ecephys/test_sorting_interfaces.py similarity index 98% rename from tests/test_on_data/test_sorting_interfaces.py rename to tests/test_on_data/ecephys/test_sorting_interfaces.py index dfb4ff599..7c572c269 100644 --- a/tests/test_on_data/test_sorting_interfaces.py +++ b/tests/test_on_data/ecephys/test_sorting_interfaces.py @@ -17,8 +17,8 @@ ) try: - from .setup_paths import ECEPHY_DATA_PATH as DATA_PATH - from .setup_paths import OUTPUT_PATH + from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH + from ..setup_paths import OUTPUT_PATH except ImportError: from setup_paths import ECEPHY_DATA_PATH as DATA_PATH from setup_paths import OUTPUT_PATH diff --git a/tests/test_on_data/test_format_converters/test_spikeglx_converter.py b/tests/test_on_data/ecephys/test_spikeglx_converter.py similarity index 100% rename from tests/test_on_data/test_format_converters/test_spikeglx_converter.py rename to tests/test_on_data/ecephys/test_spikeglx_converter.py diff --git a/tests/test_on_data/test_metadata/test_spikeglx_metadata.py b/tests/test_on_data/ecephys/test_spikeglx_metadata.py similarity index 100% rename from tests/test_on_data/test_metadata/test_spikeglx_metadata.py rename to tests/test_on_data/ecephys/test_spikeglx_metadata.py diff --git a/tests/test_on_data/test_gin_icephys.py b/tests/test_on_data/icephys/test_gin_icephys.py similarity index 98% rename from tests/test_on_data/test_gin_icephys.py rename to tests/test_on_data/icephys/test_gin_icephys.py index 31d40105a..2d71e0636 100644 --- a/tests/test_on_data/test_gin_icephys.py +++ b/tests/test_on_data/icephys/test_gin_icephys.py @@ -20,7 +20,7 @@ except ImportError: HAVE_PARAMETERIZED = False # Load the configuration for the data tests -test_config_dict = load_dict_from_file(Path(__file__).parent / "gin_test_config.json") +test_config_dict = load_dict_from_file(Path(__file__).parent.parent / "gin_test_config.json") # GIN dataset: https://gin.g-node.org/NeuralEnsemble/ephy_testing_data if os.getenv("CI"): diff --git a/tests/test_on_data/test_gin_ecephys/__init__.py b/tests/test_on_data/ophys/__init__.py similarity index 100% rename from tests/test_on_data/test_gin_ecephys/__init__.py rename to tests/test_on_data/ophys/__init__.py diff --git a/tests/test_on_data/fiber_photometry_metadata.yaml b/tests/test_on_data/ophys/fiber_photometry_metadata.yaml similarity index 100% rename from tests/test_on_data/fiber_photometry_metadata.yaml rename to tests/test_on_data/ophys/fiber_photometry_metadata.yaml diff --git a/tests/test_on_data/test_format_converters/test_brukertiff_converter.py b/tests/test_on_data/ophys/test_brukertiff_converter.py similarity index 100% rename from tests/test_on_data/test_format_converters/test_brukertiff_converter.py rename to tests/test_on_data/ophys/test_brukertiff_converter.py diff --git a/tests/test_on_data/test_fiber_photometry_interfaces.py b/tests/test_on_data/ophys/test_fiber_photometry_interfaces.py similarity index 99% rename from tests/test_on_data/test_fiber_photometry_interfaces.py rename to tests/test_on_data/ophys/test_fiber_photometry_interfaces.py index 125d892a5..b9121f08b 100644 --- a/tests/test_on_data/test_fiber_photometry_interfaces.py +++ b/tests/test_on_data/ophys/test_fiber_photometry_interfaces.py @@ -14,7 +14,7 @@ from neuroconv.utils import dict_deep_update, load_dict_from_file try: - from .setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH + from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH except ImportError: from setup_paths import OUTPUT_PATH diff --git a/tests/test_on_data/test_imaging_interfaces.py b/tests/test_on_data/ophys/test_imaging_interfaces.py similarity index 99% rename from tests/test_on_data/test_imaging_interfaces.py rename to tests/test_on_data/ophys/test_imaging_interfaces.py index 1a5328e52..8bfc8c85c 100644 --- a/tests/test_on_data/test_imaging_interfaces.py +++ b/tests/test_on_data/ophys/test_imaging_interfaces.py @@ -36,7 +36,7 @@ ) try: - from .setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH + from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH except ImportError: from setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH diff --git a/tests/test_on_data/test_metadata_combinations.py b/tests/test_on_data/ophys/test_metadata_combinations.py similarity index 98% rename from tests/test_on_data/test_metadata_combinations.py rename to tests/test_on_data/ophys/test_metadata_combinations.py index 2ba80f586..68441ae70 100644 --- a/tests/test_on_data/test_metadata_combinations.py +++ b/tests/test_on_data/ophys/test_metadata_combinations.py @@ -6,7 +6,7 @@ from neuroconv import NWBConverter from neuroconv.datainterfaces import Suite2pSegmentationInterface, TiffImagingInterface -from .setup_paths import OPHYS_DATA_PATH +from ..setup_paths import OPHYS_DATA_PATH TiffImagingInterface_source_data = dict( file_path=str(OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "demoMovie.tif"), sampling_frequency=15.0 diff --git a/tests/test_on_data/test_format_converters/test_miniscope_converter.py b/tests/test_on_data/ophys/test_miniscope_converter.py similarity index 100% rename from tests/test_on_data/test_format_converters/test_miniscope_converter.py rename to tests/test_on_data/ophys/test_miniscope_converter.py diff --git a/tests/test_on_data/test_metadata/test_neuralynx_nvt_metadata.py b/tests/test_on_data/ophys/test_neuralynx_nvt_metadata.py similarity index 100% rename from tests/test_on_data/test_metadata/test_neuralynx_nvt_metadata.py rename to tests/test_on_data/ophys/test_neuralynx_nvt_metadata.py diff --git a/tests/test_on_data/test_segmentation_interfaces.py b/tests/test_on_data/ophys/test_segmentation_interfaces.py similarity index 98% rename from tests/test_on_data/test_segmentation_interfaces.py rename to tests/test_on_data/ophys/test_segmentation_interfaces.py index 3d2547df8..b2c6428f1 100644 --- a/tests/test_on_data/test_segmentation_interfaces.py +++ b/tests/test_on_data/ophys/test_segmentation_interfaces.py @@ -11,9 +11,9 @@ ) try: - from .setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH + from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH except ImportError: - from setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH + from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH class TestCaimanSegmentationInterface(SegmentationExtractorInterfaceTestMixin): diff --git a/tests/test_on_data/test_metadata/test_maxwell_metadata.py b/tests/test_on_data/test_metadata/test_maxwell_metadata.py deleted file mode 100644 index b66653b61..000000000 --- a/tests/test_on_data/test_metadata/test_maxwell_metadata.py +++ /dev/null @@ -1,55 +0,0 @@ -import unittest -from datetime import datetime -from pathlib import Path -from platform import system -from shutil import rmtree -from tempfile import mkdtemp -from zoneinfo import ZoneInfo - -import pytest -from hdmf.testing import TestCase - -from neuroconv.datainterfaces import MaxOneRecordingInterface - -from ..setup_paths import ECEPHY_DATA_PATH - - -@pytest.mark.skipif(system() == "Linux", reason="Specific tests for raising assertion on non-linux systems.") -class TestMaxOneAssertion(TestCase): - def test_max_one_usage_assertion(self): - with self.assertRaisesWith( - exc_type=NotImplementedError, - exc_msg="The MaxOneRecordingInterface has not yet been implemented for systems other than Linux.", - ): - file_path = ECEPHY_DATA_PATH / "maxwell" / "MaxOne_data" / "Record" / "000011" / "data.raw.h5" - MaxOneRecordingInterface(file_path=file_path) - - -@pytest.mark.skip(reason="Stochastically fails to download compression library.") -# @pytest.mark.skipif(system() != "Linux", reason="MaxOne only works on Linux at the moment.") -class TestMaxOneMetadata(TestCase): - @classmethod - def setUpClass(cls): - file_path = ECEPHY_DATA_PATH / "maxwell" / "MaxOne_data" / "Record" / "000011" / "data.raw.h5" - cls.interface = MaxOneRecordingInterface(file_path=file_path) - - cls.tmpdir = Path(mkdtemp()) - cls.nwbfile_path = cls.tmpdir / "maxone_meadata_test.nwb" - cls.metadata = cls.interface.get_metadata() - cls.metadata["NWBFile"].update( - session_start_time=datetime(2020, 1, 1, 12, 30, 0, tzinfo=ZoneInfo("US/Pacific")) - ) - cls.interface.run_conversion(nwbfile_path=cls.nwbfile_path, metadata=cls.metadata) - - @classmethod - def tearDownClass(cls): - rmtree(cls.tmpdir) - - def test_neuroconv_metadata(self): - assert len(self.metadata["Ecephys"]["Device"]) == 1 - assert self.metadata["Ecephys"]["Device"][0]["name"] == "DeviceEcephys" - assert self.metadata["Ecephys"]["Device"][0]["description"] == "Recorded using Maxwell version '20190530'." - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_on_data/test_metadata/test_neuroscope.py b/tests/test_on_data/test_metadata/test_neuroscope.py deleted file mode 100644 index 576a8a019..000000000 --- a/tests/test_on_data/test_metadata/test_neuroscope.py +++ /dev/null @@ -1,130 +0,0 @@ -import unittest -from datetime import datetime - -import numpy as np -import numpy.testing as npt -import pytest -from parameterized import param, parameterized -from pynwb import NWBHDF5IO -from spikeinterface.extractors import NwbRecordingExtractor - -from neuroconv import NWBConverter -from neuroconv.datainterfaces import NeuroScopeRecordingInterface - -# enable to run locally in interactive mode -try: - from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH - from ..setup_paths import OUTPUT_PATH -except ImportError: - from setup_paths import ECEPHY_DATA_PATH as DATA_PATH - from setup_paths import OUTPUT_PATH - -if not DATA_PATH.exists(): - pytest.fail(f"No folder found in location: {DATA_PATH}!") - - -def custom_name_func(testcase_func, param_num, param): - interface_name = param.kwargs["data_interface"].__name__ - reduced_interface_name = interface_name.replace("Recording", "").replace("Interface", "").replace("Sorting", "") - - return ( - f"{testcase_func.__name__}_{param_num}_" - f"{parameterized.to_safe_name(reduced_interface_name)}" - f"_{param.kwargs.get('case_name', '')}" - ) - - -class TestNeuroscopeNwbConversions(unittest.TestCase): - savedir = OUTPUT_PATH - - @parameterized.expand( - input=[ - param( - name="complete", - conversion_options=None, - ), - param(name="stub", conversion_options=dict(TestRecording=dict(stub_test=True))), - ] - ) - def test_neuroscope_gains(self, name, conversion_options): - input_gain = 2.0 - interface_kwargs = dict(file_path=str(DATA_PATH / "neuroscope" / "test1" / "test1.dat"), gain=input_gain) - - nwbfile_path = str(self.savedir / f"test_neuroscope_gains_{name}.nwb") - - class TestConverter(NWBConverter): - data_interface_classes = dict(TestRecording=NeuroScopeRecordingInterface) - - converter = TestConverter(source_data=dict(TestRecording=interface_kwargs)) - metadata = converter.get_metadata() - metadata["NWBFile"].update(session_start_time=datetime.now().astimezone()) - converter.run_conversion( - nwbfile_path=nwbfile_path, overwrite=True, metadata=metadata, conversion_options=conversion_options - ) - - with NWBHDF5IO(path=nwbfile_path, mode="r") as io: - nwbfile = io.read() - # output_channel_conversion = nwbfile.acquisition["ElectricalSeriesRaw"].channel_conversion[:] - # input_gain_array = np.ones_like(output_channel_conversion) * input_gain - # np.testing.assert_array_almost_equal(input_gain_array, output_channel_conversion) - assert nwbfile.acquisition["ElectricalSeries"].channel_conversion is None - - nwb_recording = NwbRecordingExtractor(file_path=nwbfile_path) - nwb_recording_gains = nwb_recording.get_channel_gains() - npt.assert_almost_equal(input_gain * np.ones_like(nwb_recording_gains), nwb_recording_gains) - - @parameterized.expand( - input=[ - param( - name="complete", - conversion_options=None, - ), - param(name="stub", conversion_options=dict(TestRecording=dict(stub_test=True))), - ] - ) - def test_neuroscope_dtype(self, name, conversion_options): - interface_kwargs = dict(file_path=str(DATA_PATH / "neuroscope" / "test1" / "test1.dat"), gain=2.0) - - nwbfile_path = str(self.savedir / f"test_neuroscope_dtype_{name}.nwb") - - class TestConverter(NWBConverter): - data_interface_classes = dict(TestRecording=NeuroScopeRecordingInterface) - - converter = TestConverter(source_data=dict(TestRecording=interface_kwargs)) - metadata = converter.get_metadata() - metadata["NWBFile"].update(session_start_time=datetime.now().astimezone()) - converter.run_conversion( - nwbfile_path=nwbfile_path, overwrite=True, metadata=metadata, conversion_options=conversion_options - ) - - with NWBHDF5IO(path=nwbfile_path, mode="r") as io: - nwbfile = io.read() - output_dtype = nwbfile.acquisition["ElectricalSeries"].data.dtype - self.assertEqual(first=output_dtype, second=np.dtype("int16")) - - def test_neuroscope_starting_time(self): - nwbfile_path = str(self.savedir / "testing_start_time.nwb") - - class TestConverter(NWBConverter): - data_interface_classes = dict(TestRecording=NeuroScopeRecordingInterface) - - converter = TestConverter( - source_data=dict(TestRecording=dict(file_path=str(DATA_PATH / "neuroscope" / "test1" / "test1.dat"))) - ) - metadata = converter.get_metadata() - metadata["NWBFile"].update(session_start_time=datetime.now().astimezone()) - starting_time = 123.0 - converter.run_conversion( - nwbfile_path=nwbfile_path, - overwrite=True, - metadata=metadata, - conversion_options=dict(TestRecording=dict(starting_time=starting_time)), - ) - - with NWBHDF5IO(path=nwbfile_path, mode="r") as io: - nwbfile = io.read() - self.assertEqual(first=starting_time, second=nwbfile.acquisition["ElectricalSeries"].starting_time) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_on_data/test_metadata/__init__.py b/tests/test_on_data/test_yaml/__init__.py similarity index 100% rename from tests/test_on_data/test_metadata/__init__.py rename to tests/test_on_data/test_yaml/__init__.py diff --git a/tests/test_on_data/conversion_specifications/GIN_conversion_specification.yml b/tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification.yml similarity index 100% rename from tests/test_on_data/conversion_specifications/GIN_conversion_specification.yml rename to tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification.yml diff --git a/tests/test_on_data/conversion_specifications/GIN_conversion_specification_missing_nwbfile_names.yml b/tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification_missing_nwbfile_names.yml similarity index 100% rename from tests/test_on_data/conversion_specifications/GIN_conversion_specification_missing_nwbfile_names.yml rename to tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification_missing_nwbfile_names.yml diff --git a/tests/test_on_data/conversion_specifications/GIN_conversion_specification_no_nwbfile_name_or_other_metadata.yml b/tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification_no_nwbfile_name_or_other_metadata.yml similarity index 100% rename from tests/test_on_data/conversion_specifications/GIN_conversion_specification_no_nwbfile_name_or_other_metadata.yml rename to tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification_no_nwbfile_name_or_other_metadata.yml diff --git a/tests/test_on_data/conversion_specifications/GIN_conversion_specification_videos.yml b/tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification_videos.yml similarity index 100% rename from tests/test_on_data/conversion_specifications/GIN_conversion_specification_videos.yml rename to tests/test_on_data/test_yaml/conversion_specifications/GIN_conversion_specification_videos.yml diff --git a/tests/test_on_data/test_yaml_conversion_specification.py b/tests/test_on_data/test_yaml/test_yaml_conversion_specification.py similarity index 97% rename from tests/test_on_data/test_yaml_conversion_specification.py rename to tests/test_on_data/test_yaml/test_yaml_conversion_specification.py index 56fd7f6c3..61c71cf86 100644 --- a/tests/test_on_data/test_yaml_conversion_specification.py +++ b/tests/test_on_data/test_yaml/test_yaml_conversion_specification.py @@ -11,8 +11,8 @@ from neuroconv import run_conversion_from_yaml from neuroconv.utils import load_dict_from_file -from .setup_paths import BEHAVIOR_DATA_PATH, OUTPUT_PATH -from .setup_paths import ECEPHY_DATA_PATH as DATA_PATH +from ..setup_paths import BEHAVIOR_DATA_PATH, OUTPUT_PATH +from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH @pytest.mark.parametrize( @@ -26,7 +26,7 @@ ) def test_validate_example_specifications(fname): path_to_test_yml_files = Path(__file__).parent / "conversion_specifications" - schema_folder = path_to_test_yml_files.parent.parent.parent / "src" / "neuroconv" / "schemas" + schema_folder = path_to_test_yml_files.parent.parent.parent.parent / "src" / "neuroconv" / "schemas" specification_schema = load_dict_from_file(file_path=schema_folder / "yaml_conversion_specification_schema.json") sys_uri_base = "file://" if sys.platform.startswith("win32"): diff --git a/tests/test_on_data/test_yaml_conversion_specification_cli.py b/tests/test_on_data/test_yaml/test_yaml_conversion_specification_cli.py similarity index 98% rename from tests/test_on_data/test_yaml_conversion_specification_cli.py rename to tests/test_on_data/test_yaml/test_yaml_conversion_specification_cli.py index 1d6758fac..cc4391623 100644 --- a/tests/test_on_data/test_yaml_conversion_specification_cli.py +++ b/tests/test_on_data/test_yaml/test_yaml_conversion_specification_cli.py @@ -7,8 +7,8 @@ from neuroconv.tools import deploy_process -from .setup_paths import ECEPHY_DATA_PATH as DATA_PATH -from .setup_paths import OUTPUT_PATH +from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH +from ..setup_paths import OUTPUT_PATH class TestYAMLConversionSpecification(TestCase):