test: remove substring guard test_default_api_base (#43355)

It asserted no provider name is a substring of any other provider's default api_base, so any new provider whose name sits inside an existing hostname (sail vs parasail) broke main without a bug in our code. The litellm_proxy default api_base fix it originally guarded is covered by the explicit api_base tests in the same file

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-09-26 22:28:28 +00:00 • committed by GitHub
parent 9413b82477
commit 3afcd176b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,46 +133,6 @@ def test_get_llm_provider_azure_o1():
assert model == "o1-mini"
def test_default_api_base():
from litellm.litellm_core_utils.get_llm_provider_logic import (
_get_openai_compatible_provider_info,
)
from litellm.types.utils import LlmProviders
# Patch environment variable to remove API base if it's set
with patch.dict(os.environ, {}, clear=True):
for provider in litellm.openai_compatible_providers:
# Get the API base for the given provider
if provider == "github_copilot":
continue
# Skip chatgpt as it requires OAuth authentication
if provider == "chatgpt":
continue
# Skip ragflow as it requires specific model format: ragflow/chat/{id}/{model} or ragflow/agent/{id}/{model}
if provider == "ragflow":
continue
_, _, _, api_base = _get_openai_compatible_provider_info(
model=f"{provider}/*", api_base=None, api_key=None, dynamic_api_key=None
)
if api_base is None:
continue
for other_provider in LlmProviders:
if other_provider.value != provider and provider != "{}_chat".format(
other_provider.value
):
if provider == "codestral" and other_provider.value == "mistral":
continue
elif provider == "github" and other_provider.value == "azure":
continue
elif (
provider in ("qwencloud", "qwen_ai_platform")
and other_provider.value == "dashscope"
):
continue
assert other_provider.value not in api_base.replace("/openai", "")
def test_hosted_vllm_default_api_key():
from litellm.litellm_core_utils.get_llm_provider_logic import (
_get_openai_compatible_provider_info,