Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

test(dspy): use memory-only cache by default (#10156)

Isaac Millerc53e24904967
diff --git a/tests/conftest.py b/tests/conftest.py
index 4c514713f..bf758c768 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,7 +1,6 @@
import copy
import os
from collections.abc import Iterator
-from pathlib import Path
from typing import Any
import pytest
@@ -18,12 +17,12 @@ def _close_cache(cache: Any) -> None:
@pytest.fixture(autouse=True)
-def clear_settings(tmp_path: Path) -> Iterator[None]:
+def clear_settings() -> Iterator[None]:
"""Ensure each test gets fresh DSPy settings and an isolated cache."""
import dspy
original_cache = dspy.cache
- dspy.configure_cache(disk_cache_dir=tmp_path / ".dspy_cache")
+ dspy.configure_cache(enable_disk_cache=False, enable_memory_cache=True, disk_cache_dir=None)
try:
yield
finally: