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(test_router_init.py): cleanup tests

Krrish Dholakiaea902f40de9b
diff --git a/litellm/tests/test_router_init.py b/litellm/tests/test_router_init.py
index 13167c10f08..70b131e703f 100644
--- a/litellm/tests/test_router_init.py
+++ b/litellm/tests/test_router_init.py
@@ -59,7 +59,9 @@ def test_init_clients():
assert router.cache.get_cache(f"{model_id}_stream_async_client") is not None
# check if timeout for stream/non stream clients is set correctly
- async_client = router.cache.get_cache(f"{model_id}_async_client")
+ from openai import AsyncAzureOpenAI
+
+ async_client: AsyncAzureOpenAI = router.cache.get_cache(f"{model_id}_async_client") # type: ignore
stream_async_client = router.cache.get_cache(
f"{model_id}_stream_async_client"
)
@@ -70,12 +72,12 @@ def test_init_clients():
print()
print(async_client._base_url)
assert (
- async_client._base_url
- == "https://openai-gpt-4-test-v-1.openai.azure.com//openai/"
+ str(async_client._base_url)
+ == "https://openai-gpt-4-test-v-1.openai.azure.com/openai/"
) # openai python adds the extra /
assert (
- stream_async_client._base_url
- == "https://openai-gpt-4-test-v-1.openai.azure.com//openai/"
+ str(stream_async_client._base_url)
+ == "https://openai-gpt-4-test-v-1.openai.azure.com/openai/"
)
print("PASSED !")