From 251adc262073325b3ca9f955f1ecdb021446512f Mon Sep 17 00:00:00 2001 From: Dhwani Patel Date: Wed, 23 Oct 2024 15:53:24 -0600 Subject: [PATCH] Fix type hints issues --- fixity/fixity.py | 5 ++--- tests/test_fixity.py | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fixity/fixity.py b/fixity/fixity.py index 8aa6ad2..6f8d98b 100644 --- a/fixity/fixity.py +++ b/fixity/fixity.py @@ -12,7 +12,6 @@ from typing import Optional from typing import TextIO from typing import Type -from typing import Union from uuid import uuid4 from . import reporting @@ -312,9 +311,9 @@ def get_handler(stream, timestamps, log_level=None): def main( argv: Optional[List[str]] = None, - logger: Union[logging.Logger] = None, + logger: Optional[logging.Logger] = None, stream: Optional[TextIO] = None, -) -> Union[int, bool, Type[Exception]]: +) -> Optional[int, bool, Type[Exception]]: if logger is None: logger = get_logger() if stream is None: diff --git a/tests/test_fixity.py b/tests/test_fixity.py index e056f5c..40fe76c 100644 --- a/tests/test_fixity.py +++ b/tests/test_fixity.py @@ -675,7 +675,6 @@ def test_scanall_handles_exception_if_storage_service_raises_exception( @mock.patch("requests.get") def test_main_verifies_urls_with_trailing_slash( _get: mock.Mock, - mock_check_fixity: List[mock.Mock], monkeypatch: pytest.MonkeyPatch, ) -> None: _get.side_effect = [ @@ -706,7 +705,7 @@ def test_main_verifies_urls_with_trailing_slash( ) -def test_main_validate_arguments() -> None: +def test_main_validates_arguments() -> None: response = fixity.main(["scan"]) assert str(response) == "An AIP UUID must be specified when scanning a single AIP"