diff --git a/tap_github/authenticator.py b/tap_github/authenticator.py index d873b77..4d5182b 100644 --- a/tap_github/authenticator.py +++ b/tap_github/authenticator.py @@ -227,7 +227,7 @@ def has_calls_remaining(self) -> bool: self.claim_token() if self.token is None: if self.logger: - self.logger.warn("GitHub app token refresh failed.") + self.logger.warning("GitHub app token refresh failed.") return False else: if self.logger: @@ -308,7 +308,7 @@ def prepare_tokens(self) -> list[TokenManager]: if app_token_manager.is_valid_token(): app_token_managers.append(app_token_manager) except ValueError as e: - self.logger.warn( + self.logger.warning( f"An error was thrown while preparing an app token: {e}" ) diff --git a/tap_github/tests/test_authenticator.py b/tap_github/tests/test_authenticator.py index 042e483..5c59ce1 100644 --- a/tap_github/tests/test_authenticator.py +++ b/tap_github/tests/test_authenticator.py @@ -215,10 +215,10 @@ def test_has_calls_remaining_logs_warning_if_token_regeneration_fails(self): mock_is_valid.return_value = False assert not token_manager.has_calls_remaining() - token_manager.logger.warn.assert_called_once() + token_manager.logger.warning.assert_called_once() assert ( "GitHub app token refresh failed." - in token_manager.logger.warn.call_args[0][0] + in token_manager.logger.warning.call_args[0][0] ) def test_has_calls_remaining_succeeds_if_token_new_and_never_used(self): @@ -537,7 +537,7 @@ def test_handle_error_if_app_key_invalid(self, mock_stream): auth = GitHubTokenAuthenticator(stream=mock_stream) auth.prepare_tokens() - mock_stream.logger.warn.assert_called_with( + mock_stream.logger.warning.assert_called_with( "An error was thrown while preparing an app token: Invalid key format" )