File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,10 +206,11 @@ filterwarnings = [
206206 " ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning" ,
207207 # pywin32 internal deprecation warning
208208 " ignore:getargs.*The 'u' format is deprecated:DeprecationWarning" ,
209- # `mcp` prefers `httpx2`; HTTP surfaces warn when falling back to `httpx`. `httpx2` is
210- # not yet on PyPI, so every HTTP-touching test would trip the warning. The dedicated
211- # test in `tests/shared/test_httpx_shim.py` covers emission. Remove this entry once
212- # `httpx2` is the default and the fallback is dropped.
209+ # `mcp` prefers `httpx2`; HTTP surfaces warn when falling back to `httpx`. The lockfile
210+ # pins `httpx` (not `httpx2`), so CI always exercises the fallback and every HTTP-touching
211+ # test would trip the warning. The dedicated test in `tests/shared/test_httpx_shim.py`
212+ # covers emission. Remove this entry once `httpx2` is the dependency and the fallback is
213+ # dropped.
213214 " ignore:Using `httpx` with `mcp` is deprecated:mcp.shared._httpx.MCPDeprecationWarning" ,
214215]
215216
Original file line number Diff line number Diff line change 44[Kludex/starlette@508023b](https://github.com/Kludex/starlette/commit/508023b488b649d97c091eb60da1d8ef3636ee06)
55and [pydantic/pydantic-ai#5664](https://github.com/pydantic/pydantic-ai/pull/5664).
66
7- `httpx2` is not yet on PyPI, so every install today exercises the fallback path. The warning
8- is emitted lazily on first use (not at module import) to avoid breaking pytest's filter
9- parser during collection. The MCP v2 cut will drop the fallback and require `httpx2`.
7+ `mcp` declares `httpx` (not `httpx2`) as a dependency, so unless the user installs `httpx2`
8+ explicitly the fallback path is exercised. The warning is emitted lazily on first use (not at
9+ module import) to avoid breaking pytest's filter parser during collection. The MCP v2 cut will
10+ drop the fallback and bump the dependency to `httpx2`.
1011"""
1112
1213from __future__ import annotations
Original file line number Diff line number Diff line change @@ -70,8 +70,9 @@ async def test_create_mcp_http_client_silent_with_httpx2(
7070def test_shim_picks_up_httpx2_when_present (monkeypatch : pytest .MonkeyPatch ) -> None :
7171 """Aliasing `httpx2` to the installed `httpx` module exercises the preferred import path.
7272
73- Without this test, the `import httpx2 as httpx` branch is uncovered (since `httpx2` is not
74- yet on PyPI). Once `httpx2` is real, this test will continue to pass naturally.
73+ `mcp`'s lockfile pins `httpx` (not `httpx2`), so the `import httpx2 as httpx` branch is
74+ otherwise uncovered in CI. This test injects `httpx2` into `sys.modules` and reloads the
75+ shim to cover that branch deterministically.
7576 """
7677 import importlib
7778 import sys
You can’t perform that action at this time.
0 commit comments