File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
tests/unit/_memory_storage_client Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,16 @@ async def test_not_implemented_method(tmp_path: Path) -> None:
222
222
223
223
224
224
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
226
230
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'
230
235
231
236
232
237
async def test_storage_path_from_env_var_overrides_default (monkeypatch : pytest .MonkeyPatch ) -> None :
You can’t perform that action at this time.
0 commit comments