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]

test: fixes

Ishaan Jaff7d4741790636
diff --git a/tests/litellm_utils_tests/test_utils.py b/tests/litellm_utils_tests/test_utils.py
index c0a11bafe1e..c053287ce81 100644
--- a/tests/litellm_utils_tests/test_utils.py
+++ b/tests/litellm_utils_tests/test_utils.py
@@ -1058,7 +1058,7 @@ def test_async_http_handler_force_ipv4(mock_async_client):
# Set force_ipv4 to True
litellm.force_ipv4 = True
- litellm.use_aiohttp_transport = False
+ litellm.disable_aiohttp_transport = True
try:
timeout = 120
diff --git a/tests/llm_translation/test_text_completion_unit_tests.py b/tests/llm_translation/test_text_completion_unit_tests.py
index bf12c0cd1cc..fa416962ca9 100644
--- a/tests/llm_translation/test_text_completion_unit_tests.py
+++ b/tests/llm_translation/test_text_completion_unit_tests.py
@@ -77,7 +77,7 @@ def test_convert_dict_to_text_completion_response():
async def test_huggingface_text_completion_logprobs():
"""Test text completion with Hugging Face, focusing on logprobs structure"""
litellm.set_verbose = True
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = True # since this uses respx, we need to set use_aiohttp_transport to False
from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandler
mock_response = [
diff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.py
index 109e9b5ce50..892b75ea47c 100644
--- a/tests/local_testing/test_amazing_vertex_completion.py
+++ b/tests/local_testing/test_amazing_vertex_completion.py
@@ -3128,7 +3128,7 @@ async def test_vertexai_embedding_finetuned(respx_mock: MockRouter):
"""
load_vertex_ai_credentials()
litellm.set_verbose = True
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = True # since this uses respx, we need to set use_aiohttp_transport to False
# Test input
input_text = ["good morning from litellm", "this is another item"]
@@ -3197,7 +3197,7 @@ async def test_vertexai_model_garden_model_completion(
Using OpenAI compatible models from Vertex Model Garden
"""
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = True # since this uses respx, we need to set use_aiohttp_transport to False
litellm.module_level_aclient = httpx.AsyncClient()
load_vertex_ai_credentials()
litellm.set_verbose = True
diff --git a/tests/local_testing/test_azure_openai.py b/tests/local_testing/test_azure_openai.py
index 8cc2b325e75..ceafc37488e 100644
--- a/tests/local_testing/test_azure_openai.py
+++ b/tests/local_testing/test_azure_openai.py
@@ -40,7 +40,7 @@ async def test_aaaaazure_tenant_id_auth(respx_mock: MockRouter):
PROD Test
"""
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = True # since this uses respx, we need to set use_aiohttp_transport to False
router = Router(
model_list=[
diff --git a/tests/logging_callback_tests/test_langfuse_unit_tests.py b/tests/logging_callback_tests/test_langfuse_unit_tests.py
index b6e29042226..c89b41b8b07 100644
--- a/tests/logging_callback_tests/test_langfuse_unit_tests.py
+++ b/tests/logging_callback_tests/test_langfuse_unit_tests.py
@@ -327,7 +327,7 @@ def test_langfuse_e2e_sync(monkeypatch):
import respx
import httpx
import time
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = True # since this uses respx, we need to set use_aiohttp_transport to False
litellm._turn_on_debug()
monkeypatch.setattr(litellm, "success_callback", ["langfuse"])
diff --git a/tests/test_litellm/llms/custom_httpx/test_http_handler.py b/tests/test_litellm/llms/custom_httpx/test_http_handler.py
index 1c9810ac632..72ff0b0f447 100644
--- a/tests/test_litellm/llms/custom_httpx/test_http_handler.py
+++ b/tests/test_litellm/llms/custom_httpx/test_http_handler.py
@@ -49,7 +49,7 @@ async def test_ssl_security_level(monkeypatch):
async def test_force_ipv4_transport():
"""Test transport creation with force_ipv4 enabled"""
litellm.force_ipv4 = True
- litellm.use_aiohttp_transport = False
+ litellm.disable_aiohttp_transport = True
transport = AsyncHTTPHandler._create_async_transport()
@@ -86,7 +86,7 @@ async def test_ssl_context_transport():
@pytest.mark.asyncio
async def test_aiohttp_disabled_transport():
"""Test transport creation with aiohttp disabled"""
- litellm.use_aiohttp_transport = False
+ litellm.disable_aiohttp_transport = True
litellm.force_ipv4 = False
transport = AsyncHTTPHandler._create_async_transport()
diff --git a/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py b/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py
index 0eda5d65fd7..b4ef78b9137 100644
--- a/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py
+++ b/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py
@@ -181,7 +181,9 @@ class TestFeatherlessAIConfig:
"""
import litellm
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = (
+ True # since this uses respx, we need to set use_aiohttp_transport to False
+ )
from litellm import completion
# Set up environment variables for the test
diff --git a/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py b/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py
index 4cef9479619..cb15dd3fa3e 100644
--- a/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py
+++ b/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py
@@ -54,7 +54,9 @@ class TestNebiusConfig:
This test mocks the actual HTTP request to test the integration properly.
"""
- litellm.use_aiohttp_transport = False # since this uses respx, we need to set use_aiohttp_transport to False
+ litellm.disable_aiohttp_transport = (
+ True # since this uses respx, we need to set use_aiohttp_transport to False
+ )
# Set up environment variables for the test
api_key = "fake-nebius-key"
diff --git a/tests/test_litellm/test_main.py b/tests/test_litellm/test_main.py
index d170a6f914d..7b5349fffb1 100644
--- a/tests/test_litellm/test_main.py
+++ b/tests/test_litellm/test_main.py
@@ -290,7 +290,7 @@ async def test_extra_body_with_fallback(
"""
# since this uses respx, we need to set use_aiohttp_transport to False
- litellm.use_aiohttp_transport = False
+ litellm.disable_aiohttp_transport = True
# Set up test parameters
model = "openrouter/deepseek/deepseek-chat"
messages = [{"role": "user", "content": "Hello, world!"}]