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]

test(utils): pin the register_model replay test to the recorded half (#35994)

Yassin Kortam87dbb632b2c8
diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py
index a8eb8b11974..e80960a22c9 100644
--- a/tests/test_litellm/test_utils.py
+++ b/tests/test_litellm/test_utils.py
@@ -5036,6 +5036,11 @@ def test_reapply_runtime_registrations_replays_register_model_overrides(monkeypa
"_runtime_registered_model_cost",
dict(litellm_utils._runtime_registered_model_cost),
)
+ # Only the recorded half is under test here; the live-router rebuild is covered
+ # in test_router_model_cost_isolation.py. Routers built by earlier tests in this
+ # process stay in the weak set until they are collected, so leaving the callback
+ # installed would make this depend on when that happens.
+ monkeypatch.setattr(litellm_utils._LiveDeploymentReplay, "callback", None)
saved_model_cost = litellm.model_cost
try: