From f1ab223f941e2eb18f890b98262e516f230f6dc9 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 12 Jun 2026 17:06:02 -0700 Subject: [PATCH] test: align adapted auth builder tests with upstream imports The picked #29986 builder tests rely on 'from fastapi import status' and patch seed_request_identity, both present upstream but not on this line; add the import and drop the patch entries (the helper does not exist here so there is nothing to neutralize) --- tests/test_litellm/proxy/auth/test_user_api_key_auth.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/test_litellm/proxy/auth/test_user_api_key_auth.py b/tests/test_litellm/proxy/auth/test_user_api_key_auth.py index 1979496f487..aeed0ad2825 100644 --- a/tests/test_litellm/proxy/auth/test_user_api_key_auth.py +++ b/tests/test_litellm/proxy/auth/test_user_api_key_auth.py @@ -28,6 +28,7 @@ from litellm.proxy._types import ( from litellm.proxy.auth.handle_jwt import JWTHandler from litellm.proxy.auth.auth_checks import get_key_object, _cache_key_object from litellm.proxy.auth.route_checks import RouteChecks +from fastapi import status from litellm.proxy.auth.user_api_key_auth import ( _route_requires_auth_despite_public, _reserve_budget_after_common_checks, @@ -2962,8 +2963,7 @@ def _proxy_attrs_for_db_lookup(): async def _run_builder_with_key_lookup(get_key_object_mock): """Drive the real auth builder with ``get_key_object`` replaced by the - given mock. Returns the builder result. Patches ``seed_request_identity`` - so the failure path doesn't touch OTEL.""" + given mock. Returns the builder result.""" from fastapi import Request from starlette.datastructures import URL @@ -2982,9 +2982,6 @@ async def _run_builder_with_key_lookup(get_key_object_mock): "litellm.proxy.auth.user_api_key_auth.get_key_object", get_key_object_mock, ), - patch( - "litellm.proxy.auth.auth_exception_handler.seed_request_identity", - ), ): return await _user_api_key_auth_builder( request=request,