Skip to content

Commit ce68b25

Browse files
committed
fix: use MagicMock with async __aenter__/__aexit__ for context manager
1 parent 2d0befb commit ce68b25

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
@@ -45,7 +45,7 @@ async def test_401_produces_error_response(self):
4545
mock_response.headers = {"content-type": "text/plain"}
4646
mock_response.aread = AsyncMock(return_value=b"Unauthorized")
4747

48-
# Use async context manager mock
48+
# Use MagicMock with async __aenter__/__aexit__
4949
mock_stream_ctx = MagicMock()
5050
mock_stream_ctx.__aenter__ = AsyncMock(return_value=mock_response)
5151
mock_stream_ctx.__aexit__ = AsyncMock(return_value=False)

0 commit comments

Comments
 (0)