Skip to content

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]

fix(test): mock enterprise license check in JWT test

Julio Quinteros Pro3c61c7fbb18c
diff --git a/tests/proxy_unit_tests/test_user_api_key_auth.py b/tests/proxy_unit_tests/test_user_api_key_auth.py
index 72d13aadad3..702139643ee 100644
--- a/tests/proxy_unit_tests/test_user_api_key_auth.py
+++ b/tests/proxy_unit_tests/test_user_api_key_auth.py
@@ -1044,8 +1044,13 @@ async def test_jwt_non_admin_team_route_access(monkeypatch):
litellm.proxy.proxy_server, "general_settings", {"enable_jwt_auth": True}
)
- # Mock JWTAuthManager.auth_builder
+ # Mock enterprise license check and JWTAuthManager.auth_builder
+ # License check must be mocked to avoid environment variable pollution
+ # in parallel test execution
with patch(
+ "litellm.proxy.auth.handle_jwt.JWTAuthManager._is_jwt_auth_available",
+ return_value=True,
+ ), patch(
"litellm.proxy.auth.handle_jwt.JWTAuthManager.auth_builder",
return_value=mock_jwt_response,
):