Commit 72288d43 authored by Jan Reimes's avatar Jan Reimes
Browse files

🧪 test(workspaces): update temp_cache_dir fixture to use monkeypatch

parent 97c8f74a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -29,12 +29,13 @@ from tdoc_crawler.workspaces import (


@pytest.fixture
def temp_cache_dir(tmp_path: Path) -> Path:
def temp_cache_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
    """Create a temporary cache directory and register it."""
    # Reset CacheManager singleton to allow re-registration in tests
    CacheManager._instance = None
    cache_dir = tmp_path / ".3gpp-crawler"
    cache_dir.mkdir()
    monkeypatch.setenv("TDC_CACHE_DIR", str(cache_dir))
    # Reset CacheManager singleton to allow re-registration in tests
    CacheManager._instance = None
    CacheManager(cache_dir).register()
    return cache_dir