Skip to content

Commit 00bcb65

Browse files
author
Cody Baker
committed
debug file order in tests
1 parent a3d49f5 commit 00bcb65

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

nwbinspector/nwbinspector.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import pynwb
2020
import yaml
2121
from tqdm import tqdm
22+
from natsort import natsorted
2223

2324
from . import available_checks
2425
from .inspector_tools import (
@@ -379,7 +380,7 @@ def inspect_all(
379380
yield InspectorMessage(
380381
message=(
381382
f"The identifier '{identifier}' is used across the .nwb files: "
382-
f"{[str(x) for x in nwbfiles_with_identifier]}\n"
383+
f"{natsorted([x.name for x in nwbfiles_with_identifier])}. "
383384
"The identifier of any NWBFile should be a completely unique value - "
384385
"we recommend using uuid4 to achieve this."
385386
),
@@ -388,7 +389,7 @@ def inspect_all(
388389
object_type="NWBFile",
389390
object_name="root",
390391
location="/",
391-
file_path=str(Path(nwbfiles_with_identifier[0]).parent),
392+
file_path=str(nwbfiles_with_identifier[0].parent),
392393
)
393394

394395
nwbfiles_iterable = nwbfiles

tests/test_inspector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from pynwb.file import TimeIntervals
1212
from pynwb.behavior import SpatialSeries, Position
1313
from hdmf.common import DynamicTable
14+
from natsort import natsorted
1415

1516
from nwbinspector import (
1617
Importance,
@@ -617,12 +618,11 @@ def tearDownClass(cls):
617618
rmtree(cls.tempdir)
618619

619620
def test_check_unique_identifiers_fail(self):
620-
print(list(inspect_all(path=self.tempdir, select=["check_data_orientation"])))
621621
assert list(inspect_all(path=self.tempdir, select=["check_data_orientation"])) == [
622622
InspectorMessage(
623623
message=(
624624
"The identifier 'not a unique identifier!' is used across the .nwb files: "
625-
f"{[str(x) for x in self.non_unique_id_nwbfile_paths]}\n"
625+
f"{natsorted([Path(x).name for x in self.non_unique_id_nwbfile_paths])}. "
626626
"The identifier of any NWBFile should be a completely unique value - "
627627
"we recommend using uuid4 to achieve this."
628628
),
@@ -631,6 +631,6 @@ def test_check_unique_identifiers_fail(self):
631631
object_type="NWBFile",
632632
object_name="root",
633633
location="/",
634-
file_path=str(Path(self.non_unique_id_nwbfile_paths[0]).parent),
634+
file_path=str(self.tempdir),
635635
)
636636
]

0 commit comments

Comments
 (0)