Skip to content

Commit

Permalink
Change reset path for default
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbull committed Aug 14, 2024
1 parent 8246661 commit c5808be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloudpathlib/local/localclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def get_default_storage_dir(cls) -> Path:
def reset_default_storage_dir(cls) -> Path:
cls._default_storage_temp_dir = None

# Also reset default client so it gets recreated with new temp dir
cls._default_client = None
# Also reset storage on default client so it uses the new temp dir
cls.get_default_client()._local_storage_dir = cls.get_default_storage_dir()

return cls.get_default_storage_dir()

Expand Down
3 changes: 3 additions & 0 deletions tests/test_cloudpath_instantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def test_dependencies_not_loaded(rig, monkeypatch):
with pytest.raises(MissingDependenciesError):
rig.create_cloud_path("dir_0/file0_0.txt")

# manual reset for teardown order so teardown doesn't fail
monkeypatch.setattr(rig.path_class._cloud_meta, "dependencies_loaded", True)


def test_is_pathlike(rig):
p = rig.create_cloud_path("dir_0")
Expand Down

0 comments on commit c5808be

Please sign in to comment.