Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: remove obsolete pragma and isolate session establishment in tests
  • Loading branch information
Rashmi
Rashmi committed Sep 17, 2026
commit 0b15b01a1f88ee28431d7460623ff17268be6e77
2 changes: 1 addition & 1 deletion src/mcp/shared/_httpx_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create_mcp_http_client(
kwargs: dict[str, Any] = {"timeout": timeout}
if headers is not None:
kwargs["headers"] = headers
if auth is not None: # pragma: no cover
if auth is not None:
kwargs["auth"] = auth
return httpx2.AsyncClient(**kwargs)

Expand Down
7 changes: 4 additions & 3 deletions tests/client/test_session_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,10 @@ def record_stream_client(*args: Any, **kwargs: Any) -> mock.AsyncMock:
mock_session_cls.return_value = mock_session_cm

group = ClientSessionGroup()
async with group:
await group.connect_to_server(params_a)
await group.connect_to_server(params_b)
async with contextlib.AsyncExitStack() as stack:
group._exit_stack = stack
await group._establish_session(params_a, ClientSessionParameters())
await group._establish_session(params_b, ClientSessionParameters())

assert len(recorded_clients) == 2
assert recorded_clients[0].auth is auth_a
Expand Down
Loading