diff --git a/tests/test_asyncio/test_connection.py b/tests/test_asyncio/test_connection.py index d1aad796e7..9ee6db1566 100644 --- a/tests/test_asyncio/test_connection.py +++ b/tests/test_asyncio/test_connection.py @@ -254,9 +254,8 @@ async def do_close(): async def do_read(): return await conn.read_response() - reader = mock.AsyncMock() - writer = mock.AsyncMock() - writer.transport = mock.Mock() + reader = mock.Mock(spec=asyncio.StreamReader) + writer = mock.Mock(spec=asyncio.StreamWriter) writer.transport.get_extra_info.side_effect = None # for HiredisParser