Isolate landing document tests from server corpus

This commit is contained in:
anor
2026-12-01 17:17:56 +10:00
parent 94e3dde629
commit 3a2f89793c
+12
View File
@@ -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)