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(mcp): keep manifest test active on Python 3.10 via tomli fallback

mateo-berri09c9e4360ef1
diff --git a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py b/tests/test_litellm/experimental_mcp_client/test_mcp_client.py
index 53fbaf8ddb7..b1182dd7262 100644
--- a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py
+++ b/tests/test_litellm/experimental_mcp_client/test_mcp_client.py
@@ -1068,13 +1068,18 @@ async def test_http_transport_without_streamable_http_client_raises_actionable_i
transport_type=MCPTransport.http,
)
- with patch.object(mcp_client_module, "streamable_http_client", None): # test-quality-ok: simulates mcp<1.24.0 whose module lacks this import-time symbol; no HTTP boundary exists before the raise
+ with patch.object( # test-quality-ok: simulates mcp<1.24.0 whose module lacks this import-time symbol
+ mcp_client_module, "streamable_http_client", None
+ ):
with pytest.raises(ImportError, match=r"pip install 'litellm\[mcp\]'"):
await client.list_tools(raise_on_error=True)
def test_mcp_extra_matches_proxy_extra_and_supports_streamable_http():
- tomllib = pytest.importorskip("tomllib")
+ try:
+ import tomllib
+ except ImportError:
+ tomllib = pytest.importorskip("tomli")
from packaging.requirements import Requirement
pyproject_path = Path(__file__).parents[3] / "pyproject.toml"