Skip to content

Commit

Permalink
correct test imports
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 13, 2024
1 parent d71b667 commit 565e791
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 38 deletions.
2 changes: 1 addition & 1 deletion tests/read_nwbfile_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pynwb.testing.mock.base import mock_TimeSeries

from nwbinspector.tools import read_nwbfile
from nwbinspector.testing._testing import (
from nwbinspector.testing import (
check_streaming_tests_enabled,
check_hdf5_io_open,
check_zarr_io_open,
Expand Down
8 changes: 3 additions & 5 deletions tests/streaming_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
from pathlib import Path
from unittest import TestCase

from nwbinspector import Importance
from nwbinspector import inspect_all
from nwbinspector._registration import InspectorMessage
from nwbinspector import Importance, inspect_all, InspectorMessage
from nwbinspector.tools import read_nwbfile
from nwbinspector.testing._testing import check_streaming_tests_enabled, check_hdf5_io_open
from nwbinspector.utils._utils import FilePathType
from nwbinspector.testing import check_streaming_tests_enabled, check_hdf5_io_open
from nwbinspector.utils import FilePathType


STREAMING_TESTS_ENABLED, DISABLED_STREAMING_TESTS_REASON = check_streaming_tests_enabled()
Expand Down
4 changes: 3 additions & 1 deletion tests/test_check_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
check_timestamps_match_first_dimension,
available_checks,
default_check_registry,
validate_config,
configure_checks,
load_config,
)
from nwbinspector import validate_config, configure_checks, load_config
from nwbinspector._configuration import _copy_function


Expand Down
2 changes: 1 addition & 1 deletion tests/test_register_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from hdmf.testing import TestCase
from pynwb import TimeSeries

from nwbinspector._registration import register_check, Importance, Severity, InspectorMessage
from nwbinspector import register_check, Importance, Severity, InspectorMessage


class TestRegisterClass(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from hdmf.testing import TestCase

from nwbinspector import Importance
from nwbinspector.utils._utils import (
from nwbinspector.utils import (
format_byte_size,
is_regular_series,
is_dict_in_string,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np

from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks.behavior import (
from nwbinspector.checks import (
check_compass_direction_unit,
check_spatial_series_dims,
check_spatial_series_degrees_magnitude,
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from pynwb.misc import Units
from hdmf.common.table import DynamicTableRegion, DynamicTable

from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_negative_spike_times,
check_electrical_series_dims,
check_electrical_series_reference_electrodes_table,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/test_general.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from hdmf.common import DynamicTable

from nwbinspector import InspectorMessage, Importance, check_name_slashes, check_description
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import check_name_slashes, check_description


def test_check_name_slashes_pass():
Expand Down
5 changes: 3 additions & 2 deletions tests/unit_tests/test_icephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from pynwb.icephys import IntracellularElectrode
from pynwb.device import Device

from nwbinspector import InspectorMessage, Importance, check_intracellular_electrode_cell_id_exists
from nwbinspector.utils._utils import get_package_version
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import check_intracellular_electrode_cell_id_exists
from nwbinspector.utils import get_package_version

PYNWB_VERSION_LOWER_2_1_0 = get_package_version(name="pynwb") < Version("2.1.0")
PYNWB_VERSION_LOWER_SKIP_REASON = "This test requires PyNWB>=2.1.0"
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_image_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from pynwb import NWBHDF5IO, H5DataIO
from pynwb.image import ImageSeries

from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_image_series_external_file_valid,
check_image_series_external_file_relative,
check_image_series_data_size,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from packaging.version import Version

from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks.images import (
from nwbinspector.checks import (
check_order_of_images_unique,
check_order_of_images_len,
check_index_series_points_to_image,
)
from nwbinspector.utils._utils import get_package_version
from nwbinspector.utils import get_package_version

HAVE_IMAGES = get_package_version(name="pynwb") >= Version("2.1.0")
skip_reason = "You must have PyNWB>=v2.1.0 to run these tests!"
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_nwb_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
from pynwb import NWBContainer, NWBFile
from pynwb.image import ImageSeries

from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_small_dataset_compression,
check_large_dataset_compression,
check_empty_string_for_optional_attribute,
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_nwbfile_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from pynwb import NWBFile, ProcessingModule
from pynwb.file import Subject

from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_experimenter_exists,
check_experimenter_form,
check_experiment_description,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_ogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pynwb.device import Device
from pynwb.file import NWBFile

from nwbinspector import check_optogenetic_stimulus_site_has_optogenetic_series
from nwbinspector.checks import check_optogenetic_stimulus_site_has_optogenetic_series


class TestCheckOptogeneticStimulusSiteHasOptogeneticSeries(TestCase):
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_ophys.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
)
from hdmf.common.table import DynamicTableRegion, DynamicTable

from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_roi_response_series_dims,
check_roi_response_series_link_to_plane_segmentation,
check_excitation_lambda_in_nm,
Expand Down
7 changes: 3 additions & 4 deletions tests/unit_tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from hdmf.common import DynamicTable, DynamicTableRegion
from pynwb.file import TimeIntervals, Units, ElectrodeTable, ElectrodeGroup, Device

from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_empty_table,
check_time_interval_time_columns,
check_time_intervals_stop_after_start,
Expand All @@ -21,7 +20,7 @@
check_ids_unique,
check_table_time_columns_are_not_negative,
)
from nwbinspector.utils._utils import get_package_version
from nwbinspector.utils import get_package_version


class TestCheckDynamicTableRegion(TestCase):
Expand Down
5 changes: 2 additions & 3 deletions tests/unit_tests/test_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
from packaging import version


from nwbinspector import (
InspectorMessage,
Importance,
from nwbinspector import InspectorMessage, Importance
from nwbinspector.checks import (
check_regular_timestamps,
check_data_orientation,
check_timestamps_match_first_dimension,
Expand Down

0 comments on commit 565e791

Please sign in to comment.