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]

tests(vcr): force pure-httpx transport when VCR is active

mateo-berri265a94cd602f
diff --git a/tests/llm_responses_api_testing/conftest.py b/tests/llm_responses_api_testing/conftest.py
index 01257cd26be..948debbf95c 100644
--- a/tests/llm_responses_api_testing/conftest.py
+++ b/tests/llm_responses_api_testing/conftest.py
@@ -97,6 +97,11 @@ def pytest_recording_configure(config, vcr):
if _vcr_disabled():
return
vcr.register_persister(make_redis_persister())
+ # vcrpy patches httpx's transport; litellm's default AiohttpTransport
+ # routes around httpx and produces empty responses under the patched
+ # transport. Force pure-httpx transport so vcrpy can record/replay.
+ litellm.disable_aiohttp_transport = True
+ os.environ["DISABLE_AIOHTTP_TRANSPORT"] = "True"
@pytest.fixture(scope="session")
diff --git a/tests/llm_translation/conftest.py b/tests/llm_translation/conftest.py
index 132ebd57ad8..2215b1c24b4 100644
--- a/tests/llm_translation/conftest.py
+++ b/tests/llm_translation/conftest.py
@@ -121,6 +121,11 @@ def pytest_recording_configure(config, vcr):
if _vcr_disabled():
return
vcr.register_persister(make_redis_persister())
+ # vcrpy patches httpx's transport; litellm's default AiohttpTransport
+ # routes around httpx and produces empty responses under the patched
+ # transport. Force pure-httpx transport so vcrpy can record/replay.
+ litellm.disable_aiohttp_transport = True
+ os.environ["DISABLE_AIOHTTP_TRANSPORT"] = "True"
# ---------------------------------------------------------------------------