fix(test): drive MCP identity-header tests through sdk_httpx(), not httpx directly
mcp 2.0 moved the SDK's HTTP stack to httpx2, so patching httpx.AsyncClient no longer intercepts the client Hermes builds for the SDK — the exact pattern test_mcp_client_cert.py already documents and works around. This file predates that awareness; 3 of its 13 tests were silently asserting on an unpatched client and failing under the real mcp==2.0.0 install this branch pins.
This commit is contained in:
@@ -138,7 +138,7 @@ def _drive_http(server, config):
|
||||
kwargs passed to ``httpx.AsyncClient``. Mirrors the pattern in
|
||||
``test_mcp_client_cert.py``.
|
||||
"""
|
||||
from tools.mcp_tool import MCPServerTask
|
||||
from tools.mcp_tool import MCPServerTask, sdk_httpx
|
||||
|
||||
captured: dict = {}
|
||||
|
||||
@@ -178,7 +178,7 @@ def _drive_http(server, config):
|
||||
async def _drive():
|
||||
with patch("tools.mcp_tool._MCP_HTTP_AVAILABLE", True), \
|
||||
patch("tools.mcp_tool._MCP_NEW_HTTP", True), \
|
||||
patch("httpx.AsyncClient", DummyAsyncClient), \
|
||||
patch.object(sdk_httpx(), "AsyncClient", DummyAsyncClient), \
|
||||
patch("tools.mcp_tool.streamable_http_client",
|
||||
return_value=DummyTransportCtx()), \
|
||||
patch("tools.mcp_tool.ClientSession", DummySession), \
|
||||
|
||||
Reference in New Issue
Block a user