Skip to content

Commit ae9269d

Browse files
committed
changed expected exception when cache dir is a file to FileExistsError
1 parent f022435 commit ae9269d

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

pydra/utils/hash.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ def location_default(cls):
105105
def _location_default(self):
106106
return self.location_default()
107107

108-
@location.validator
109-
def location_validator(self, _, location):
110-
if not os.path.isdir(location):
111-
raise ValueError(
112-
f"Persistent cache location '{location}' is not a directory"
113-
)
114-
115108
@cleanup_period.default
116109
def cleanup_period_default(self):
117110
return int(os.environ.get(self.CLEANUP_ENV_VAR, 30))

pydra/utils/tests/test_hash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,5 +384,5 @@ def test_persistent_hash_cache_not_dir(text_file):
384384
"""
385385
Test that an error is raised if the provided cache path is not a directory
386386
"""
387-
with pytest.raises(ValueError, match="is not a directory"):
387+
with pytest.raises(FileExistsError):
388388
PersistentCache(text_file.fspath)

0 commit comments

Comments
 (0)