diff --git a/tests/unit/anthropic_interface/exceptions/test_exception_mapping_utils.py b/tests/unit/anthropic_interface/exceptions/test_exception_mapping_utils.py index 4f29791d566..210ab6717aa 100644 --- a/tests/unit/anthropic_interface/exceptions/test_exception_mapping_utils.py +++ b/tests/unit/anthropic_interface/exceptions/test_exception_mapping_utils.py @@ -65,13 +65,13 @@ class TestCreateErrorResponse: @pytest.mark.parametrize("status_code", [402, 405, 409, 418, 422, 504]) def test_a_status_outside_the_table_stays_an_api_error_for_the_sdk_and_stream_frames(self, status_code: int): - response = AnthropicExceptionMapping.create_error_response(status_code, "scripted status") - frame = anthropic_error_sse_frame(status_code=status_code, raw_message="scripted status") + response: Final = AnthropicExceptionMapping.create_error_response(status_code, "scripted status") + frame: Final = anthropic_error_sse_frame(status_code=status_code, raw_message="scripted status") assert response["error"]["type"] == "api_error" assert frame.error_response["error"]["type"] == "api_error" def test_an_explicit_error_type_wins_over_the_status_table(self): - response = AnthropicExceptionMapping.create_error_response(402, "Budget exceeded", error_type="billing_error") + response: Final = AnthropicExceptionMapping.create_error_response(402, "Budget exceeded", error_type="billing_error") assert response["error"]["type"] == "billing_error" diff --git a/tests/unit/proxy/anthropic_endpoints/test_endpoints.py b/tests/unit/proxy/anthropic_endpoints/test_endpoints.py index bd1beada8c1..5d9b3c0a7ab 100644 --- a/tests/unit/proxy/anthropic_endpoints/test_endpoints.py +++ b/tests/unit/proxy/anthropic_endpoints/test_endpoints.py @@ -208,10 +208,9 @@ class TestProxyExceptionAnthropicEnvelope: import litellm.proxy.anthropic_endpoints.endpoints as ep from litellm.proxy._types import ProxyException - request = MagicMock() - request.headers = {} + request: Final = MagicMock(headers={}) - response = ep._anthropic_error_json_response( + response: Final = ep._anthropic_error_json_response( ProxyException(message="scripted", type="budget_exceeded", param=None, code=status_code), request )