OPEN SOURCE
software/tests/conftest.py
Read on this site and download the files you need.
Nichijoyaku was created using AI. A complete review by human biblical-language and biblical-studies specialists has not been established. Read alongside established translations and original-language resources.
← Back to the open-source guide
1"""Test-suite-wide safety rails.23The production translation memory is the product of multi-day, quota-limited4runs and cannot be regenerated cheaply. A test that constructs5`TranslationMemoryManager()` with no path would read *and write* it — that has6already happened once, leaking fixture segments into the real store.78The autouse fixture below redirects the default path for every test, so the9production store is unreachable from the suite no matter what a test does.10"""1112from __future__ import annotations1314from pathlib import Path1516import pytest1718import src.context.translation_memory as tm_module192021@pytest.fixture(autouse=True)22def _never_touch_the_production_memory(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:23"""Point the default memory path at a per-test temp directory.2425Args:26tmp_path: Pytest's per-test temp directory.27monkeypatch: Pytest's patching fixture.28"""29monkeypatch.setattr(30tm_module, "DEFAULT_STORAGE_PATH", tmp_path / "memory" / "segments.json"31)32