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
test: isolate router callback state
mateo7b86b7f4cd75
diff --git a/tests/test_litellm/test_router_retry_policy_update.py b/tests/test_litellm/test_router_retry_policy_update.pyindex 2c23d0da7e7..db710f76887 100644--- a/tests/test_litellm/test_router_retry_policy_update.py+++ b/tests/test_litellm/test_router_retry_policy_update.py@@ -21,6 +21,7 @@ This file pins both halves of the fix.import jsonfrom dataclasses import dataclass+from typing import Finalfrom unittest.mock import AsyncMock, MagicMockimport pytest@@ -33,6 +34,14 @@ from litellm.router_utils.pre_call_checks.model_rate_limit_check import ModelRatfrom litellm.router_utils.pre_call_checks.prompt_caching_deployment_check import PromptCachingDeploymentCheckfrom litellm.types.router import RetryPolicy, UpdateRouterConfig+[email protected](autouse=True)+def isolate_litellm_callbacks():+ callbacks_before: Final = litellm.callbacks.copy()+ yield+ litellm.callbacks = callbacks_before++# ---------------------------------------------------------------------------# UpdateRouterConfig schema membership (LIT-3152 part 1)# ---------------------------------------------------------------------------