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]

Make tests run with local beta header mapping json

Sameer Kankuted4dbb460cc7a
diff --git a/tests/test_litellm/test_anthropic_beta_headers_filtering.py b/tests/test_litellm/test_anthropic_beta_headers_filtering.py
index 880e96f40a9..a2c5608828a 100644
--- a/tests/test_litellm/test_anthropic_beta_headers_filtering.py
+++ b/tests/test_litellm/test_anthropic_beta_headers_filtering.py
@@ -24,8 +24,15 @@ class TestAnthropicBetaHeadersFiltering:
"""Test beta header filtering and mapping for all providers."""
@pytest.fixture(autouse=True)
- def setup(self):
+ def setup(self, monkeypatch):
"""Load the beta headers config for testing."""
+ # Force use of local config file for tests
+ monkeypatch.setenv("LITELLM_LOCAL_ANTHROPIC_BETA_HEADERS", "True")
+
+ # Clear the cached config to ensure fresh load with local config
+ from litellm import anthropic_beta_headers_manager
+ anthropic_beta_headers_manager._BETA_HEADERS_CONFIG = None
+
config_path = os.path.join(
os.path.dirname(litellm.__file__),
"anthropic_beta_headers_config.json",