From ce59e6f00a4bd5bc1d88dd6f0158f10f94326889 Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Fri, 20 Feb 2026 11:36:54 -0300 Subject: [PATCH] fix(tests): use unconditional skip for vertex/gemini token counting test The parametrized test covers both gemini-2.5-pro (needs GEMINI_API_KEY) and vertex-ai-gemini-2.5-pro (needs VERTEX_AI_PRIVATE_KEY). A skipif on GEMINI_API_KEY alone was insufficient for the vertex variant. Switch to @pytest.mark.skip to guard both parametrizations consistently. Addresses Greptile review comment on PR #21669. Co-Authored-By: Claude Sonnet 4.6 --- tests/proxy_unit_tests/test_proxy_token_counter.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/proxy_unit_tests/test_proxy_token_counter.py b/tests/proxy_unit_tests/test_proxy_token_counter.py index 445e4880eb..cca1e84360 100644 --- a/tests/proxy_unit_tests/test_proxy_token_counter.py +++ b/tests/proxy_unit_tests/test_proxy_token_counter.py @@ -682,9 +682,8 @@ async def test_factory_registration(): assert not counter.should_use_token_counting_api(custom_llm_provider=None) -@pytest.mark.skipif( - not os.getenv("GEMINI_API_KEY") and not os.getenv("GOOGLE_API_KEY"), - reason="Requires Google API credentials.", +@pytest.mark.skip( + reason="Requires Google/Vertex AI credentials (GEMINI_API_KEY or VERTEX_AI_PRIVATE_KEY)." ) @pytest.mark.asyncio @pytest.mark.parametrize("model_name", ["gemini-2.5-pro", "vertex-ai-gemini-2.5-pro"])