The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(test): add environment cleanup for Vertex AI Qwen tests
Julio Quinteros Pro62ac8cee8ef5
diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.pyindex 6310431813b..bdf391ba5b4 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.py@@ -24,6 +24,30 @@ from litellm.llms.vertex_ai.vertex_llm_base import VertexBasefrom litellm.types.llms.vertex_ai import VertexPartnerProvider[email protected](autouse=True)+def clean_vertex_env():+ """Clear Google/Vertex AI environment variables before each test to prevent test isolation issues."""+ saved_env = {}+ env_vars_to_clear = [+ "GOOGLE_APPLICATION_CREDENTIALS",+ "GOOGLE_CLOUD_PROJECT",+ "VERTEXAI_PROJECT",+ "VERTEX_PROJECT",+ "VERTEX_LOCATION",+ "VERTEX_AI_PROJECT",+ ]+ for var in env_vars_to_clear:+ if var in os.environ:+ saved_env[var] = os.environ[var]+ del os.environ[var]++ yield++ # Restore saved environment variables+ for var, value in saved_env.items():+ os.environ[var] = value++class TestQwenGlobalOnlyDetection:"""Test that Qwen models are correctly identified as global-only."""