Skip to content

Commit 6d401d2

Browse files
committed
update test_default_storage_path_used test
1 parent f088726 commit 6d401d2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/unit/_memory_storage_client/test_memory_storage_client.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,16 @@ async def test_not_implemented_method(tmp_path: Path) -> None:
222222

223223

224224
async def test_default_storage_path_used(monkeypatch: pytest.MonkeyPatch) -> None:
225-
# We expect the default value to be used
225+
# Reset the configuration in service locator
226+
service_locator._service_locator._configuration = None
227+
service_locator._service_locator._configuration_was_set = False
228+
229+
# Remove the env var for setting the storage directory
226230
monkeypatch.delenv('CRAWLEE_STORAGE_DIR', raising=False)
227-
service_locator.set_configuration(Configuration())
228-
ms = MemoryStorageClient()
229-
assert ms.storage_dir == './storage'
231+
232+
# Initialize the service locator with default configuration
233+
msc = MemoryStorageClient()
234+
assert msc.storage_dir == './storage'
230235

231236

232237
async def test_storage_path_from_env_var_overrides_default(monkeypatch: pytest.MonkeyPatch) -> None:

0 commit comments

Comments
 (0)