公開前の確認用サイト
日常訳NICHIJOYAKUEnglish ↗

OPEN SOURCE

software/tests/conftest.py

このサイトで読み、必要なファイルを保存できます。

日常訳はAIを用いて作成された翻訳です。人間の聖書学・原語の専門家による全訳の検証は確認されていません。既存の翻訳や原語資料と照らし合わせてお読みください。

← オープンソースの案内へ

software/tests/conftest.py32 行このファイルを保存 ↓

ZIPに含まれるものと同じ公開ソースです。行番号から、その行へのリンクを保存できます。

ファイルの確認情報SHA-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