From 48d2cd1c56b10a66fde6541ccf2ee9f454969cd7 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 28 Oct 2026 18:16:02 -0700 Subject: [PATCH] test(anthropic): mark the new test variables Final --- .../exceptions/test_exception_mapping_utils.py | 6 +++--- tests/unit/proxy/anthropic_endpoints/test_endpoints.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) 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 )