Pre-publication review draft
日常訳NICHIJOYAKU日本語 ↗

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

software/tests/conftest.py32 linesDownload this file ↓

This is the same source included in the download. Each line number is a link you can save or share.

File verification detailsSHA-256 d020afbb4647e83c1f1d61b73b24b7cf141df6ffc6c7227cd08955c169d9932b
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.2425    Args:26        tmp_path: Pytest's per-test temp directory.27        monkeypatch: Pytest's patching fixture.28    """29    monkeypatch.setattr(30        tm_module, "DEFAULT_STORAGE_PATH", tmp_path / "memory" / "segments.json"31    )32