Merge pull request #8259 from hugovk/rm-is_directory

Remove unused _util.is_directory
This commit is contained in:
Andrew Murray 2024-07-25 09:47:30 +10:00 committed by GitHub
commit 6dd4b3c826
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 27 deletions

View File

@ -30,28 +30,6 @@ def test_is_not_path(tmp_path: Path) -> None:
assert not it_is_not assert not it_is_not
def test_is_directory() -> None:
# Arrange
directory = "Tests"
# Act
it_is = _util.is_directory(directory)
# Assert
assert it_is
def test_is_not_directory() -> None:
# Arrange
text = "abc"
# Act
it_is_not = _util.is_directory(text)
# Assert
assert not it_is_not
def test_deferred_error() -> None: def test_deferred_error() -> None:
# Arrange # Arrange

View File

@ -10,11 +10,6 @@ def is_path(f: Any) -> TypeGuard[StrOrBytesPath]:
return isinstance(f, (bytes, str, os.PathLike)) return isinstance(f, (bytes, str, os.PathLike))
def is_directory(f: Any) -> TypeGuard[StrOrBytesPath]:
"""Checks if an object is a string, and that it points to a directory."""
return is_path(f) and os.path.isdir(f)
class DeferredError: class DeferredError:
def __init__(self, ex: BaseException): def __init__(self, ex: BaseException):
self.ex = ex self.ex = ex