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(caching): assert sync cache-hit logging without depending on thread order (#47093)
yuneng-jiang77c2ac18bd88
diff --git a/tests/unit/caching/test_caching_handler.py b/tests/unit/caching/test_caching_handler.pyindex 388e4c42ea0..51754c80dd6 100644--- a/tests/unit/caching/test_caching_handler.py+++ b/tests/unit/caching/test_caching_handler.py@@ -42,6 +42,7 @@ from litellm.types.utils import (Embedding,)from litellm.types.llms.openai import ResponsesAPIResponse+from collections import Counterfrom collections.abc import Awaitable, Callable, Mappingfrom datetime import timedelta, datetimefrom typing import Final, cast@@ -104,7 +105,7 @@ def test_sync_cache_hits_reach_sync_custom_logger(call(**request_kwargs)assert all_logged.wait(timeout=10)- assert logged_cache_hits == [None, True, True]+ assert Counter(logged_cache_hits) == Counter({None: 1, True: 2}), logged_cache_hits@pytest.fixture