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): mock environment variables for callback validation test
Julio Quinteros Pro2d41b03f8b66
diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.pyindex 9aecfe9886b..e34cad66ba6 100644--- a/tests/proxy_unit_tests/test_proxy_utils.py+++ b/tests/proxy_unit_tests/test_proxy_utils.py@@ -1170,17 +1170,25 @@ def test_team_callback_metadata_none_values(none_key):assert none_key not in resp-def test_proxy_config_state_post_init_callback_call():+def test_proxy_config_state_post_init_callback_call(monkeypatch):"""Ensures team_id is still in config, after callback is calledAddresses issue: https://github.com/BerriAI/litellm/issues/6787Where team_id was being popped from config, after callback was called++ Note: Environment variables are mocked to avoid validation errors+ in parallel execution where env vars may not be set."""from litellm.proxy.litellm_pre_call_utils import LiteLLMProxyRequestSetupfrom litellm.proxy.proxy_server import ProxyConfig+ # Mock environment variables to avoid Pydantic validation errors+ # when env vars are resolved to None in parallel execution+ monkeypatch.setenv("LANGFUSE_PUBLIC_KEY", "test_public_key")+ monkeypatch.setenv("LANGFUSE_SECRET_KEY", "test_secret_key")+pc = ProxyConfig()pc.update_config_state(