fix: fixed real data directory being used in tests
This commit is contained in:
@@ -21,6 +21,16 @@ def temp_dir():
|
|||||||
shutil.rmtree(dirpath)
|
shutil.rmtree(dirpath)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def mock_memory_storage_dir(monkeypatch):
|
||||||
|
"""Override MEMORY_STORAGE_DIR for all tests to use a temp directory."""
|
||||||
|
test_dir = tempfile.mkdtemp()
|
||||||
|
monkeypatch.setenv("MEMORY_STORAGE_DIR", test_dir)
|
||||||
|
yield
|
||||||
|
# Cleanup
|
||||||
|
shutil.rmtree(test_dir, ignore_errors=True)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def memory(temp_dir):
|
def memory(temp_dir):
|
||||||
"""Create a fresh Memory instance for testing."""
|
"""Create a fresh Memory instance for testing."""
|
||||||
|
|||||||
Reference in New Issue
Block a user