From ec16fb7da6fb9753047da11b601768231dd09529 Mon Sep 17 00:00:00 2001 From: Mai Nakagawa Date: Fri, 10 Apr 2026 15:16:51 +0900 Subject: [PATCH] bypass auth dependency in google endpoint tests --- .../proxy/google_endpoints/test_google_api_endpoints.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py b/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py index b6c7b580383..aa3e7ce1b45 100644 --- a/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py +++ b/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py @@ -20,12 +20,18 @@ def _make_app(): from fastapi.responses import JSONResponse from fastapi.testclient import TestClient - from litellm.proxy._types import ProxyException + from litellm.proxy._types import ProxyException, UserAPIKeyAuth + from litellm.proxy.auth.user_api_key_auth import user_api_key_auth from litellm.proxy.google_endpoints.endpoints import router as google_router except ImportError as e: return None, None app = FastAPI() + # Bypass authentication in tests — user_api_key_auth enforces API key validation + # which requires a running proxy and database. Override with a no-op stub. + app.dependency_overrides[user_api_key_auth] = lambda: UserAPIKeyAuth( + api_key="sk-test" + ) app.include_router(google_router) @app.exception_handler(ProxyException)