fix: resync uv.lock and update vertex test mocks to VertexBase

The partner/gemma/model-garden handlers now call self._ensure_access_token
(inherited from VertexBase) instead of instantiating VertexLLM, so tests
must patch VertexBase._ensure_access_token for the mock to take effect.
This commit is contained in:
mateo-berri 2026-04-23 10:17:17 -07:00
parent 2f240b2a12
commit 17a638cab9
4 changed files with 20 additions and 20 deletions

View file

@ -118,7 +118,7 @@ async def test_vertex_ai_gpt_oss_simple_request():
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
) as mock_http_handler,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-token", "pathrise-convert-1606954137718"),
),
patch.dict(
@ -217,7 +217,7 @@ async def test_vertex_ai_gpt_oss_reasoning_effort():
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
) as mock_http_handler,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-token", "pathrise-convert-1606954137718"),
),
patch.dict(

View file

@ -179,7 +179,7 @@ async def test_vertex_ai_qwen_global_endpoint_url():
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
) as mock_http_handler,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-token", "test-project"),
),
patch.dict(

View file

@ -125,7 +125,7 @@ class TestVertexGemmaCompletion:
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
) as mock_http_handler,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-access-token", "PROJECT_ID"),
),
):
@ -213,7 +213,7 @@ class TestVertexGemmaCompletion:
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
) as mock_http_handler,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-access-token", "test-project"),
),
):
@ -286,7 +286,7 @@ class TestVertexGemmaCompletion:
"litellm.llms.custom_httpx.http_handler.get_async_httpx_client"
) as mock_get_client,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-access-token", "PROJECT_ID"),
),
):
@ -388,7 +388,7 @@ class TestVertexGemmaCompletion:
"litellm.llms.custom_httpx.http_handler.get_async_httpx_client"
) as mock_get_client,
patch(
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
"litellm.llms.vertex_ai.vertex_llm_base.VertexBase._ensure_access_token",
return_value=("fake-access-token", "PROJECT_ID"),
),
):

26
uv.lock generated
View file

@ -9,7 +9,7 @@ resolution-markers = [
]
[options]
exclude-newer = "2026-04-16T02:00:05.930008Z"
exclude-newer = "2026-04-20T17:15:10.783024Z"
exclude-newer-span = "P3D"
[manifest]
@ -3261,7 +3261,7 @@ proxy-dev = [
[package.metadata]
requires-dist = [
{ name = "a2a-sdk", marker = "extra == 'extra-proxy'", specifier = "==0.3.24" },
{ name = "aiohttp", specifier = "==3.13.3" },
{ name = "aiohttp", specifier = ">=3.10" },
{ name = "anthropic", extras = ["vertex"], marker = "extra == 'proxy-runtime'", specifier = "==0.84.0" },
{ name = "apscheduler", marker = "extra == 'proxy'", specifier = "==3.11.2" },
{ name = "aurelio-sdk", marker = "python_full_version < '3.14' and extra == 'semantic-router'", specifier = "==0.0.19" },
@ -3273,14 +3273,14 @@ requires-dist = [
{ name = "azure-storage-file-datalake", marker = "extra == 'proxy-runtime'", specifier = "==12.20.0" },
{ name = "backoff", marker = "extra == 'proxy'", specifier = "==2.2.1" },
{ name = "boto3", marker = "extra == 'proxy'", specifier = "==1.42.59" },
{ name = "click", specifier = "==8.1.8" },
{ name = "click", specifier = ">=8.0.0" },
{ name = "cryptography", marker = "extra == 'proxy'", specifier = "==46.0.7" },
{ name = "ddtrace", marker = "extra == 'proxy-runtime'", specifier = "==2.19.0" },
{ name = "detect-secrets", marker = "extra == 'proxy-runtime'", specifier = "==1.5.0" },
{ name = "diskcache", marker = "extra == 'caching'", specifier = "==5.6.3" },
{ name = "fastapi", marker = "extra == 'proxy'", specifier = "==0.124.4" },
{ name = "fastapi-sso", marker = "extra == 'proxy'", specifier = "==0.19.0" },
{ name = "fastuuid", specifier = "==0.14.0" },
{ name = "fastuuid", specifier = ">=0.14.0" },
{ name = "google-cloud-aiplatform", marker = "extra == 'google'", specifier = "==1.133.0" },
{ name = "google-cloud-aiplatform", marker = "extra == 'proxy-runtime'", specifier = "==1.133.0" },
{ name = "google-cloud-iam", marker = "extra == 'extra-proxy'", specifier = "==2.19.1" },
@ -3289,10 +3289,10 @@ requires-dist = [
{ name = "grpcio", marker = "extra == 'grpc'", specifier = "==1.78.0" },
{ name = "grpcio", marker = "extra == 'proxy-runtime'", specifier = "==1.78.0" },
{ name = "gunicorn", marker = "extra == 'proxy'", specifier = "==23.0.0" },
{ name = "httpx", specifier = "==0.28.1" },
{ name = "importlib-metadata", specifier = "==8.5.0" },
{ name = "jinja2", specifier = "==3.1.6" },
{ name = "jsonschema", specifier = "==4.23.0" },
{ name = "httpx", specifier = ">=0.28.0" },
{ name = "importlib-metadata", specifier = ">=6.0.0" },
{ name = "jinja2", specifier = ">=3.1.0" },
{ name = "jsonschema", specifier = ">=4.0.0" },
{ name = "langfuse", marker = "extra == 'proxy-runtime'", specifier = "==2.59.7" },
{ name = "litellm-enterprise", marker = "extra == 'proxy'", editable = "enterprise" },
{ name = "litellm-proxy-extras", marker = "extra == 'proxy'", editable = "litellm-proxy-extras" },
@ -3301,7 +3301,7 @@ requires-dist = [
{ name = "mcp", marker = "extra == 'proxy'", specifier = "==1.26.0" },
{ name = "mlflow", marker = "extra == 'mlflow'", specifier = "==3.9.0" },
{ name = "numpydoc", marker = "extra == 'utils'", specifier = "==1.8.0" },
{ name = "openai", specifier = "==2.24.0" },
{ name = "openai", specifier = ">=2.0.0" },
{ name = "opentelemetry-api", marker = "extra == 'proxy-runtime'", specifier = "==1.28.0" },
{ name = "opentelemetry-exporter-otlp", marker = "extra == 'proxy-runtime'", specifier = "==1.28.0" },
{ name = "opentelemetry-sdk", marker = "extra == 'proxy-runtime'", specifier = "==1.28.0" },
@ -3309,12 +3309,12 @@ requires-dist = [
{ name = "polars", marker = "extra == 'proxy'", specifier = "==1.38.1" },
{ name = "prisma", marker = "extra == 'extra-proxy'", specifier = "==0.11.0" },
{ name = "prometheus-client", marker = "extra == 'proxy-runtime'", specifier = "==0.20.0" },
{ name = "pydantic", specifier = "==2.12.5" },
{ name = "pydantic", specifier = ">=2.5.0,<3.0.0" },
{ name = "pyjwt", marker = "extra == 'proxy'", specifier = "==2.11.0" },
{ name = "pynacl", marker = "extra == 'proxy'", specifier = "==1.6.2" },
{ name = "pypdf", marker = "python_full_version < '3.14' and extra == 'proxy-runtime'", specifier = "==6.7.5" },
{ name = "pyroscope-io", marker = "sys_platform != 'win32' and extra == 'proxy'", specifier = "==0.8.16" },
{ name = "python-dotenv", specifier = "==1.0.1" },
{ name = "python-dotenv", specifier = ">=1.0.0" },
{ name = "python-multipart", marker = "extra == 'proxy'", specifier = "==0.0.26" },
{ name = "pyyaml", marker = "extra == 'proxy'", specifier = "==6.0.3" },
{ name = "redisvl", marker = "python_full_version < '3.14' and extra == 'extra-proxy'", specifier = "==0.4.1" },
@ -3325,8 +3325,8 @@ requires-dist = [
{ name = "semantic-router", marker = "python_full_version < '3.14' and extra == 'semantic-router'", specifier = "==0.1.12" },
{ name = "sentry-sdk", marker = "extra == 'proxy-runtime'", specifier = "==2.21.0" },
{ name = "soundfile", marker = "extra == 'proxy'", specifier = "==0.12.1" },
{ name = "tiktoken", specifier = "==0.12.0" },
{ name = "tokenizers", specifier = "==0.22.2" },
{ name = "tiktoken", specifier = ">=0.7.0" },
{ name = "tokenizers", specifier = ">=0.19.0" },
{ name = "uvicorn", marker = "extra == 'proxy'", specifier = "==0.33.0" },
{ name = "uvloop", marker = "sys_platform != 'win32' and extra == 'proxy'", specifier = "==0.21.0" },
{ name = "websockets", marker = "extra == 'proxy'", specifier = "==15.0.1" },