"""Fixturi: depozit intr-un tmp, zero retea, zero Ollama.""" from __future__ import annotations import pathlib import sys import pytest RAG = pathlib.Path(__file__).resolve().parent.parent / "rag" if str(RAG) not in sys.path: sys.path.insert(0, str(RAG)) import config # noqa: E402 @pytest.fixture(autouse=True) def docs_dir(tmp_path, monkeypatch): monkeypatch.setenv("MARIA_BRIDGE_DIR", str(tmp_path)) config.reload(tmp_path) d = config.DOCS_DIR d.mkdir(parents=True, exist_ok=True) yield d config.reload() @pytest.fixture def write(docs_dir): def _write(name: str, text: str): (docs_dir / name).write_text(text, encoding="utf-8") return docs_dir / name return _write