diff --git a/tests/test_public_documents_landing.py b/tests/test_public_documents_landing.py index 8d51531..0eaf78e 100644 --- a/tests/test_public_documents_landing.py +++ b/tests/test_public_documents_landing.py @@ -2,12 +2,24 @@ import json import sys from pathlib import Path +import pytest ROOT = Path(__file__).resolve().parents[1] if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) +@pytest.fixture(autouse=True) +def isolated_normative_project(tmp_path, monkeypatch): + """Тесты с маленьким корпусом не наследуют путь к нормативной базе стенда.""" + import public_documents + + monkeypatch.setenv("SMETA_PROJECT_DIR", str(tmp_path / "empty_norms")) + public_documents.clear_cache() + yield + public_documents.clear_cache() + + def _tsn(root: Path, key: str, title: str, fetched: str): d = root / "snapshots" / "niac_tsn" / "collections" / key d.mkdir(parents=True)