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(otel v2): clear the cached LITELLM_OTEL_V2 flag after each destination test so it stops leaking into later modules
yucheng1ccbc51ed808
diff --git a/tests/test_litellm/integrations/otel/test_otel_v2_destinations.py b/tests/test_litellm/integrations/otel/test_otel_v2_destinations.pyindex c1de5cfc0c3..2f31f6725fd 100644--- a/tests/test_litellm/integrations/otel/test_otel_v2_destinations.py+++ b/tests/test_litellm/integrations/otel/test_otel_v2_destinations.py@@ -82,6 +82,15 @@ def isolate_published_provider(monkeypatch):monkeypatch.setattr(otel_logger, "_published_v2_provider", None)[email protected](autouse=True)+def forget_otel_v2_flag_after_each_test():+ """``is_otel_v2_enabled`` caches its first answer. Tests here flip ``LITELLM_OTEL_V2``+ through monkeypatch, which restores the env but not the cache, so the next module+ on the worker would keep seeing v2 on."""+ yield+ is_otel_v2_enabled.cache_clear()++def in_fresh_context(fn, *args):"""Run ``fn`` in its own context so one test's destinations never leak."""return contextvars.copy_context().run(fn, *args)