Skip to content

Commit

Permalink
changed expected exception when cache dir is a file to FileExistsError
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Mar 17, 2024
1 parent f022435 commit ae9269d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions pydra/utils/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ def location_default(cls):
def _location_default(self):
return self.location_default()

@location.validator
def location_validator(self, _, location):
if not os.path.isdir(location):
raise ValueError(
f"Persistent cache location '{location}' is not a directory"
)

@cleanup_period.default
def cleanup_period_default(self):
return int(os.environ.get(self.CLEANUP_ENV_VAR, 30))
Expand Down
2 changes: 1 addition & 1 deletion pydra/utils/tests/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,5 @@ def test_persistent_hash_cache_not_dir(text_file):
"""
Test that an error is raised if the provided cache path is not a directory
"""
with pytest.raises(ValueError, match="is not a directory"):
with pytest.raises(FileExistsError):
PersistentCache(text_file.fspath)

0 comments on commit ae9269d

Please sign in to comment.