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 policy registry teardown in tests

shivam1f3d9a32f926
diff --git a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py b/tests/test_litellm/proxy/test_litellm_pre_call_utils.py
index 72d04e8e871..4e24d8af653 100644
--- a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py
+++ b/tests/test_litellm/proxy/test_litellm_pre_call_utils.py
@@ -2871,6 +2871,7 @@ async def test_api_created_global_policy_applies_to_new_key_without_restart():
policy_registry = get_policy_registry()
attachment_registry = get_attachment_registry()
policy_registry._policies = {}
+ policy_registry._policies_by_id = {}
policy_registry._initialized = False
attachment_registry._attachments = []
attachment_registry._initialized = False
@@ -2894,6 +2895,7 @@ async def test_api_created_global_policy_applies_to_new_key_without_restart():
assert "runtime-global-policy" in data["metadata"]["applied_policies"]
finally:
policy_registry._policies = {}
+ policy_registry._policies_by_id = {}
policy_registry._initialized = False
attachment_registry._attachments = []
attachment_registry._initialized = False