Skip to content

Commit 8f5df96

Browse files
committed
fix: use MagicMock for client to support async context manager
ctx.client needs to be MagicMock (not AsyncMock) because stream() returns an async context manager, not a coroutine.
1 parent ce68b25 commit 8f5df96

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/client/test_non2xx_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _make_request_context(self, request_id: str = "test-123") -> MagicMock:
2626
ctx.session_message.message = MagicMock(spec=JSONRPCRequest)
2727
ctx.session_message.message.id = request_id
2828
ctx.read_stream_writer = AsyncMock()
29-
ctx.client = AsyncMock()
29+
ctx.client = MagicMock() # Use MagicMock for client (not AsyncMock)
3030
ctx.metadata = None
3131
return ctx
3232

0 commit comments

Comments
 (0)