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): scope ERROR log assertion to LiteLLM logger in test_model_alias_map

Cursor Agent3215874e400d
diff --git a/tests/local_testing/test_model_alias_map.py b/tests/local_testing/test_model_alias_map.py
index cf731d66283..14c1de2f6a7 100644
--- a/tests/local_testing/test_model_alias_map.py
+++ b/tests/local_testing/test_model_alias_map.py
@@ -30,10 +30,9 @@ def test_model_alias_map(caplog):
)
print(response.model)
- captured_logs = [rec.levelname for rec in caplog.records]
-
- for log in captured_logs:
- assert "ERROR" not in log
+ for rec in caplog.records:
+ if rec.levelname == "ERROR" and rec.name.startswith("LiteLLM"):
+ pytest.fail(f"Unexpected litellm ERROR log: {rec.getMessage()}")
assert "llama-3.1-8b-instant" in response.model
except litellm.ServiceUnavailableError: