From f29a239012c279436f137ba3f06ab52d70cdd058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Wed, 2 Aug 2023 16:34:40 +0000 Subject: [PATCH] Fix mock signature to prevent resource warning for async method --- tests/test_asyncio/test_connection.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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