- articles_ci.yml: fix script path (scripts/ → tools/scripts/) - deduplicate_nomenclature.py, validate_articles_structure.py: fix parents[1] → parents[2] so REPO_ROOT resolves to the repo root instead of tools/ - validate/run_validations.py: fix schema_dir to use actual repo root (parents[3]) / data/schemas/ - src/config.py: fix _validate_app_config — all section keys were passed with a dotted prefix (e.g. "paths.inbox") as dict lookup keys, causing validation to always fail; strip prefix so only the leaf key is used for lookup - tests/conftest.py: add tools/ to sys.path so scripts.* imports work; fix schemas_dir fixture to point to data/schemas/ - tests/test_schemas.py: use absolute path to data/schemas/ instead of relative "schemas" - tests/test_schema_validation.py: fix schemas_dir to data/schemas/ and update expected schema path mappings - tests/test_processor.py: add missing dimension_patterns, text_normalization to parsing_rules fixture; add logging.max_size_mb and logging.backup_count to app.yaml fixture - tests/test_knowledge_base_builder.py: fix sys.path to point to tools/scripts/ not scripts/ - tests/test_table_scraper.py: fix sources path to src/sources/ not sources/ - CLAUDE.md: clarify schemas location, unique key distinction, coverage scope https://claude.ai/code/session_017v9w8FTSjT5646A2W98DPV
30 lines
654 B
Python
30 lines
654 B
Python
"""Shared pytest fixtures for all tests."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
# Allow tests to import from tools/scripts/ as `scripts.*`
|
|
_tools_dir = str(Path(__file__).resolve().parents[1] / "tools")
|
|
if _tools_dir not in sys.path:
|
|
sys.path.insert(0, _tools_dir)
|
|
|
|
|
|
@pytest.fixture
|
|
def repo_root():
|
|
"""Return the repository root directory."""
|
|
return Path(__file__).resolve().parents[1]
|
|
|
|
|
|
@pytest.fixture
|
|
def data_dir(repo_root):
|
|
"""Return the data directory."""
|
|
return repo_root / "data"
|
|
|
|
|
|
@pytest.fixture
|
|
def schemas_dir(repo_root):
|
|
"""Return the schemas directory."""
|
|
return repo_root / "data" / "schemas"
|