Isolate landing document tests from server corpus
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user