Skip to content

Commit 82f61bd

Browse files
author
VRTXOmega
committed
fix: use AsyncMock for session stack teardown assertion
MagicMock doesn't have assert_awaited_once — needs AsyncMock for async assertion methods. Switch the session_stack mock in the teardown test.
1 parent e80f9ff commit 82f61bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/client/test_session_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ async def test_session_group_with_external_exit_stack(
550550
async def test_session_group_teardown_closes_session_stacks() -> None:
551551
"""__aexit__ closes every session-level exit stack sequentially."""
552552
session = mock.MagicMock(spec=mcp.ClientSession)
553-
session_stack = mock.MagicMock(spec=contextlib.AsyncExitStack)
553+
session_stack = mock.AsyncMock()
554554

555555
async with ClientSessionGroup() as group:
556556
group._session_exit_stacks[session] = session_stack

0 commit comments

Comments
 (0)