Skip to content

Commit 20a97a5

Browse files
yarikopticclaude
andcommitted
refactor: move validation tests into dandi/validate/tests/
- test_validate.py → dandi/validate/tests/test_core.py - test_validate_types.py → dandi/validate/tests/test_types.py - Update relative imports in moved test files - Fix circular import: don't eagerly import core in __init__.py Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0b1d1ca commit 20a97a5

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

dandi/validate/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
- core: Main validation functions (validate, validate_bids)
1111
- types: Data types and models (ValidationResult, Origin, Severity, etc.)
1212
- io: JSONL read/write utilities for validation results
13+
14+
Note: core is NOT eagerly imported here to avoid circular imports
15+
(core → dandi.files → dandi.validate.types → dandi.validate.__init__).
16+
Import from dandi.validate.core directly for validate/validate_bids.
1317
"""
1418

15-
from .core import validate, validate_bids
1619
from .types import (
1720
ORIGIN_INTERNAL_DANDI,
1821
ORIGIN_VALIDATION_DANDI,
@@ -41,6 +44,4 @@
4144
"Standard",
4245
"ValidationResult",
4346
"Validator",
44-
"validate",
45-
"validate_bids",
4647
]

dandi/validate/tests/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44

55
import pytest
66

7-
from .fixtures import BIDS_TESTDATA_SELECTION
8-
from .. import __version__
9-
from ..consts import dandiset_metadata_file
10-
from ..validate.core import validate
11-
from ..validate.types import (
7+
from ..core import validate
8+
from ..types import (
129
Origin,
1310
OriginType,
1411
Scope,
@@ -17,6 +14,9 @@
1714
ValidationResult,
1815
Validator,
1916
)
17+
from ... import __version__
18+
from ...consts import dandiset_metadata_file
19+
from ...tests.fixtures import BIDS_TESTDATA_SELECTION
2020

2121

2222
def test_validate_nwb_error(simple3_nwb: Path) -> None:

0 commit comments

Comments
 (0)