From 3b2c5cc79274e708952385fed9d2a2970c1d4962 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 14 Nov 2023 13:05:09 +0100 Subject: [PATCH] test: Let mocker.path.object figure out the mock type to use in packet stream tests --- tests/test_packet_stream.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_packet_stream.py b/tests/test_packet_stream.py index 2e54202..215c82c 100644 --- a/tests/test_packet_stream.py +++ b/tests/test_packet_stream.py @@ -266,9 +266,7 @@ async def test_message_stream(ps_client, mocker): # pylint: disable=redefined-o assert ps.req_counter == 2 assert ps.register_handler.call_count == 1 # pylint: disable=no-member handler = list(ps._event_map.values())[0][1] # pylint: disable=protected-access - mock_process = mocker.AsyncMock() - - mocker.patch.object(handler, "process", mock_process) + mock_process = mocker.patch.object(handler, "process") ps_client.feed([b"\n\x00\x00\x02\xc5\xff\xff\xff\xff", MSG_BODY_1]) msg = await ps.read() @@ -342,9 +340,7 @@ async def test_message_request(ps_server, mocker): # pylint: disable=redefined- assert ps.req_counter == 2 assert ps.register_handler.call_count == 1 # pylint: disable=no-member handler = list(ps._event_map.values())[0][1] # pylint: disable=protected-access - mock_process = mocker.AsyncMock() - - mocker.patch.object(handler, "process", mock_process) + mock_process = mocker.patch.object(handler, "process") ps_server.feed( [ b"\x02\x00\x00\x00>\xff\xff\xff\xff",