diff --git a/tests/unit_test/test_async/test_api/test_client/test_abc.py b/tests/unit_test/test_async/test_api/test_client/test_abc.py index 01b7ecc7..eaa9b4e3 100644 --- a/tests/unit_test/test_async/test_api/test_client/test_abc.py +++ b/tests/unit_test/test_async/test_api/test_client/test_abc.py @@ -88,7 +88,7 @@ async def test____iter_received_packets____stop_if_an_error_occurs( packets = [p async for p in client.iter_received_packets(timeout=timeout)] # Assert - assert client.mock_recv_packet.mock_calls == [mocker.call() for _ in range(2)] + assert client.mock_recv_packet.call_args_list == [mocker.call() for _ in range(2)] assert packets == [mocker.sentinel.packet_a] async def test____iter_received_packets____timeout_decrement( diff --git a/tests/unit_test/test_async/test_api/test_client/test_tcp.py b/tests/unit_test/test_async/test_api/test_client/test_tcp.py index 9c6a8e2a..cd20fd05 100644 --- a/tests/unit_test/test_async/test_api/test_client/test_tcp.py +++ b/tests/unit_test/test_async/test_api/test_client/test_tcp.py @@ -208,7 +208,7 @@ async def test____dunder_init____connect_to_remote( mock_stream_socket_adapter.socket.assert_called_once_with() mock_tcp_socket.getsockname.assert_called_once_with() mock_tcp_socket.getpeername.assert_called_once_with() - assert mock_tcp_socket.setsockopt.mock_calls == [ + assert mock_tcp_socket.setsockopt.call_args_list == [ mocker.call(IPPROTO_TCP, TCP_NODELAY, True), mocker.call(SOL_SOCKET, SO_KEEPALIVE, True), ] @@ -275,7 +275,7 @@ async def test____dunder_init____use_given_socket( mock_stream_socket_adapter.socket.assert_called_once_with() mock_tcp_socket.getsockname.assert_called_once_with() mock_tcp_socket.getpeername.assert_called_once_with() - assert mock_tcp_socket.setsockopt.mock_calls == [ + assert mock_tcp_socket.setsockopt.call_args_list == [ mocker.call(IPPROTO_TCP, TCP_NODELAY, True), mocker.call(SOL_SOCKET, SO_KEEPALIVE, True), ] @@ -451,7 +451,7 @@ async def test____dunder_init____ssl( mock_stream_socket_adapter.socket.assert_called_once_with() mock_tcp_socket.getsockname.assert_called_once_with() mock_tcp_socket.getpeername.assert_called_once_with() - assert mock_tcp_socket.setsockopt.mock_calls == [ + assert mock_tcp_socket.setsockopt.call_args_list == [ mocker.call(IPPROTO_TCP, TCP_NODELAY, True), mocker.call(SOL_SOCKET, SO_KEEPALIVE, True), ] @@ -1203,8 +1203,8 @@ async def test____recv_packet____partial_data( # Assert mock_backend.coro_yield.assert_not_awaited() - assert mock_stream_socket_adapter.recv.mock_calls == [mocker.call(MAX_STREAM_BUFSIZE) for _ in range(2)] - assert mock_stream_data_consumer.feed.mock_calls == [mocker.call(b"pac"), mocker.call(b"ket\n")] + assert mock_stream_socket_adapter.recv.call_args_list == [mocker.call(MAX_STREAM_BUFSIZE) for _ in range(2)] + assert mock_stream_data_consumer.feed.call_args_list == [mocker.call(b"pac"), mocker.call(b"ket\n")] assert packet is mocker.sentinel.packet @pytest.mark.usefixtures("setup_consumer_mock") diff --git a/tests/unit_test/test_async/test_api/test_client/test_udp.py b/tests/unit_test/test_async/test_api/test_client/test_udp.py index f72e0377..f0e7a646 100644 --- a/tests/unit_test/test_async/test_api/test_client/test_udp.py +++ b/tests/unit_test/test_async/test_api/test_client/test_udp.py @@ -799,7 +799,7 @@ async def test____iter_received_packets_from____yields_available_packets_until_e # Assert assert mock_datagram_socket_adapter.recvfrom.await_args_list == [mocker.call(MAX_DATAGRAM_BUFSIZE) for _ in range(3)] - assert mock_datagram_protocol.build_packet_from_datagram.mock_calls == [ + assert mock_datagram_protocol.build_packet_from_datagram.call_args_list == [ mocker.call(b"packet_1"), mocker.call(b"packet_2"), ] diff --git a/tests/unit_test/test_async/test_asyncio_backend/test_backend.py b/tests/unit_test/test_async/test_asyncio_backend/test_backend.py index 2fc12836..439c2538 100644 --- a/tests/unit_test/test_async/test_asyncio_backend/test_backend.py +++ b/tests/unit_test/test_async/test_asyncio_backend/test_backend.py @@ -948,7 +948,7 @@ async def test____create_tcp_listeners____bind_to_any_interfaces( reuse_address=mocker.ANY, # Determined according to OS reuse_port=mocker.sentinel.reuse_port, ) - assert mock_ListenerSocketAdapter.mock_calls == [ + assert mock_ListenerSocketAdapter.call_args_list == [ mocker.call(mock_tcp_socket, event_loop, expected_factory) for _ in range(2) ] assert listener_sockets == [mocker.sentinel.listener_socket, mocker.sentinel.listener_socket] @@ -1064,7 +1064,7 @@ async def test____create_tcp_listeners____bind_to_several_hosts( reuse_address=mocker.ANY, # Determined according to OS reuse_port=mocker.sentinel.reuse_port, ) - assert mock_ListenerSocketAdapter.mock_calls == [ + assert mock_ListenerSocketAdapter.call_args_list == [ mocker.call(mock_tcp_socket, event_loop, expected_factory) for _ in range(2) ] assert listener_sockets == [mocker.sentinel.listener_socket, mocker.sentinel.listener_socket] diff --git a/tests/unit_test/test_async/test_asyncio_backend/test_datagram.py b/tests/unit_test/test_async/test_asyncio_backend/test_datagram.py index 7aa875ab..4db36012 100644 --- a/tests/unit_test/test_async/test_asyncio_backend/test_datagram.py +++ b/tests/unit_test/test_async/test_asyncio_backend/test_datagram.py @@ -294,7 +294,7 @@ async def test____recvfrom____connection_lost____transport_closed_by_protocol_wh # Assert assert exc_info.value.errno == ECONNABORTED - assert len(mock_asyncio_exception_queue.get_nowait.mock_calls) == 2 + assert len(mock_asyncio_exception_queue.get_nowait.call_args_list) == 2 mock_asyncio_recv_queue.get.assert_awaited_once_with() async def test____recvfrom____raise_exception____protocol_already_sent_exception_in_queue( @@ -343,7 +343,7 @@ def get_nowait_side_effect() -> Exception: await endpoint.recvfrom() # Assert - assert len(mock_asyncio_exception_queue.get_nowait.mock_calls) == 2 + assert len(mock_asyncio_exception_queue.get_nowait.call_args_list) == 2 mock_asyncio_recv_queue.get.assert_awaited_once_with() @pytest.mark.parametrize("address", [("127.0.0.1", 12345), None], ids=repr) diff --git a/tests/unit_test/test_async/test_asyncio_backend/test_socket.py b/tests/unit_test/test_async/test_asyncio_backend/test_socket.py index 018eb2ce..7a0a6cca 100644 --- a/tests/unit_test/test_async/test_asyncio_backend/test_socket.py +++ b/tests/unit_test/test_async/test_asyncio_backend/test_socket.py @@ -68,7 +68,7 @@ async def _busy_socket_task( ) -> asyncio.Task[Any]: accept_task = event_loop.create_task(coroutine) async with asyncio.timeout(5): - while len(mock_socket_method.mock_calls) == 0: + while len(mock_socket_method.call_args_list) == 0: await asyncio.sleep(0) mock_socket_method.reset_mock() return accept_task diff --git a/tests/unit_test/test_async/test_asyncio_backend/test_utils.py b/tests/unit_test/test_async/test_asyncio_backend/test_utils.py index 404bdf16..dcbdaf8b 100644 --- a/tests/unit_test/test_async/test_asyncio_backend/test_utils.py +++ b/tests/unit_test/test_async/test_asyncio_backend/test_utils.py @@ -285,7 +285,7 @@ async def test____create_connection____first_failed( socket = await create_connection(remote_host, remote_port, event_loop, local_address=local_address) # Assert - assert mock_socket_cls.mock_calls == [ + assert mock_socket_cls.call_args_list == [ mocker.call(AF_INET, SOCK_STREAM, IPPROTO_TCP), mocker.call(AF_INET6, SOCK_STREAM, IPPROTO_TCP), ] @@ -359,7 +359,7 @@ async def test____create_connection____all_failed( assert all(isinstance(exc, OSError) for exc in os_errors.exceptions) del os_errors - assert mock_socket_cls.mock_calls == [ + assert mock_socket_cls.call_args_list == [ mocker.call(AF_INET, SOCK_STREAM, IPPROTO_TCP), mocker.call(AF_INET6, SOCK_STREAM, IPPROTO_TCP), ] @@ -595,7 +595,7 @@ async def test____create_datagram_socket____first_failed( ) # Assert - assert mock_socket_cls.mock_calls == [ + assert mock_socket_cls.call_args_list == [ mocker.call(AF_INET, SOCK_DGRAM, IPPROTO_UDP), mocker.call(AF_INET6, SOCK_DGRAM, IPPROTO_UDP), ] @@ -668,7 +668,7 @@ async def test____create_datagram_socket____all_failed( assert all(isinstance(exc, OSError) for exc in os_errors.exceptions) del os_errors - assert mock_socket_cls.mock_calls == [ + assert mock_socket_cls.call_args_list == [ mocker.call(AF_INET, SOCK_DGRAM, IPPROTO_UDP), mocker.call(AF_INET6, SOCK_DGRAM, IPPROTO_UDP), ] @@ -888,7 +888,7 @@ def test____open_listener_sockets_from_getaddrinfo_result____create_listener_soc # Assert assert len(sockets) == len(addrinfo_list) - assert mock_socket_cls.mock_calls == [mocker.call(f, t, p) for f, t, p, _, _ in addrinfo_list] + assert mock_socket_cls.call_args_list == [mocker.call(f, t, p) for f, t, p, _, _ in addrinfo_list] for socket, (sock_family, _, _, _, sock_addr) in zip(sockets, addrinfo_list, strict=True): if reuse_address and SO_REUSEADDR_available: socket.setsockopt.assert_any_call(SOL_SOCKET, SO_REUSEADDR, True) diff --git a/tests/unit_test/test_serializers/test_abc.py b/tests/unit_test/test_serializers/test_abc.py index cde00f51..44656ce2 100644 --- a/tests/unit_test/test_serializers/test_abc.py +++ b/tests/unit_test/test_serializers/test_abc.py @@ -810,7 +810,7 @@ def side_effect(file: IO[bytes]) -> Any: packet, remaining_data = exc_info.value.value # Assert - assert len(mock_load_from_file_func.mock_calls) == 4 + assert len(mock_load_from_file_func.call_args_list) == 4 assert packet is mocker.sentinel.packet assert remaining_data == b"" diff --git a/tests/unit_test/test_serializers/test_compressor.py b/tests/unit_test/test_serializers/test_compressor.py index 260ba413..f8f8471e 100644 --- a/tests/unit_test/test_serializers/test_compressor.py +++ b/tests/unit_test/test_serializers/test_compressor.py @@ -275,8 +275,8 @@ def test____incremental_deserialize____decompress_chunks( # Assert mock_serializer_new_decompressor_stream.assert_called_once_with() - assert mock_decompressor_stream.decompress.mock_calls == [mocker.call(b"chunk 1"), mocker.call(b"chunk 2")] - assert len(mock_decompressor_stream_eof.mock_calls) == 3 + assert mock_decompressor_stream.decompress.call_args_list == [mocker.call(b"chunk 1"), mocker.call(b"chunk 2")] + assert len(mock_decompressor_stream_eof.call_args_list) == 3 mock_decompressor_stream_unused_data.assert_called_once() mock_serializer.deserialize.assert_called_once_with(b"decompressed chunk 1 decompressed chunk 2") assert packet is mocker.sentinel.packet @@ -354,7 +354,7 @@ def test____incremental_deserialize____translate_deserialize_errors( # Assert mock_serializer_new_decompressor_stream.assert_called_once_with() mock_decompressor_stream.decompress.assert_called_once_with(b"chunk") - assert len(mock_decompressor_stream_eof.mock_calls) == 2 + assert len(mock_decompressor_stream_eof.call_args_list) == 2 mock_decompressor_stream_unused_data.assert_called_once() mock_serializer.deserialize.assert_called_once_with(b"decompressed chunk") assert exception.__cause__ is mock_serializer.deserialize.side_effect diff --git a/tests/unit_test/test_sync/test_client/test_abc.py b/tests/unit_test/test_sync/test_client/test_abc.py index 603aace2..d64fbde2 100644 --- a/tests/unit_test/test_sync/test_client/test_abc.py +++ b/tests/unit_test/test_sync/test_client/test_abc.py @@ -76,7 +76,7 @@ def side_effect(timeout: Any) -> Any: packets = list(client.iter_received_packets(timeout=123456789)) # Assert - assert client.mock_recv_packet.mock_calls == [mocker.call(123456789) for _ in range(4)] + assert client.mock_recv_packet.call_args_list == [mocker.call(123456789) for _ in range(4)] assert packets == [mocker.sentinel.packet_a, mocker.sentinel.packet_b, mocker.sentinel.packet_c] @pytest.mark.parametrize("timeout", [123456789, None]) @@ -97,7 +97,7 @@ def test____iter_received_packets____with_given_timeout_stop_if_an_error_occurs( packets = list(client.iter_received_packets(timeout=timeout)) # Assert - assert client.mock_recv_packet.mock_calls == [mocker.call(timeout) for _ in range(2)] + assert client.mock_recv_packet.call_args_list == [mocker.call(timeout) for _ in range(2)] assert packets == [mocker.sentinel.packet_a] def test____iter_received_packets____timeout_decrement( diff --git a/tests/unit_test/test_sync/test_client/test_tcp.py b/tests/unit_test/test_sync/test_client/test_tcp.py index 91c05ad0..fba2560f 100644 --- a/tests/unit_test/test_sync/test_client/test_tcp.py +++ b/tests/unit_test/test_sync/test_client/test_tcp.py @@ -337,7 +337,7 @@ def test____dunder_init____connect_to_remote( mock_ssl_socket.getsockname.assert_not_called() mock_ssl_socket.getpeername.assert_not_called() - assert used_socket.setsockopt.mock_calls == [ + assert used_socket.setsockopt.call_args_list == [ mocker.call(IPPROTO_TCP, TCP_NODELAY, True), mocker.call(SOL_SOCKET, SO_KEEPALIVE, True), ] @@ -402,7 +402,7 @@ def test____dunder_init____use_given_socket( mock_ssl_socket.getsockname.assert_not_called() mock_ssl_socket.getpeername.assert_not_called() - assert used_socket.setsockopt.mock_calls == [ + assert used_socket.setsockopt.call_args_list == [ mocker.call(IPPROTO_TCP, TCP_NODELAY, True), mocker.call(SOL_SOCKET, SO_KEEPALIVE, True), ] @@ -942,11 +942,11 @@ def test____dunder_init____ssl____handshake_timeout( # Assert if expected_timeout == 0: - assert len(mock_ssl_socket.do_handshake.mock_calls) == 1 + assert len(mock_ssl_socket.do_handshake.call_args_list) == 1 mock_selector_register.assert_not_called() mock_selector_select.assert_not_called() else: - assert len(mock_ssl_socket.do_handshake.mock_calls) == 2 + assert len(mock_ssl_socket.do_handshake.call_args_list) == 2 mock_selector_register.assert_called_once_with(mock_ssl_socket, would_block_event) mock_selector_select.assert_called_once_with(expected_timeout) @@ -1240,7 +1240,7 @@ def test____send_packet____blocking_operation( if send_timeout != 0: mock_selector_register.assert_called_with(mock_used_socket, EVENT_WRITE) mock_selector_select.assert_called() - assert mock_used_socket.send.mock_calls == [ + assert mock_used_socket.send.call_args_list == [ mocker.call(b"packet\n"), mocker.call(b"packet\n"), mocker.call(b"et\n"), @@ -1249,7 +1249,7 @@ def test____send_packet____blocking_operation( else: mock_selector_register.assert_not_called() mock_selector_select.assert_not_called() - assert mock_used_socket.send.mock_calls == [mocker.call(b"packet\n")] + assert mock_used_socket.send.call_args_list == [mocker.call(b"packet\n")] mock_used_socket.getsockopt.assert_not_called() @pytest.mark.usefixtures("setup_producer_mock") @@ -1514,8 +1514,8 @@ def test____recv_packet____blocking____partial_data( # Assert mock_used_socket.settimeout.assert_not_called() mock_used_socket.setblocking.assert_not_called() - assert mock_used_socket.recv.mock_calls == [mocker.call(MAX_STREAM_BUFSIZE) for _ in range(2)] - assert mock_stream_data_consumer.feed.mock_calls == [mocker.call(b"pac"), mocker.call(b"ket\n")] + assert mock_used_socket.recv.call_args_list == [mocker.call(MAX_STREAM_BUFSIZE) for _ in range(2)] + assert mock_stream_data_consumer.feed.call_args_list == [mocker.call(b"pac"), mocker.call(b"ket\n")] assert packet is mocker.sentinel.packet @pytest.mark.parametrize("recv_timeout", [0], indirect=True) # Only test with timeout==0 @@ -1544,8 +1544,8 @@ def test____recv_packet_____non_blocking____partial_data( if max_recv_size == 3: packet: Any = client.recv_packet(timeout=recv_timeout) - assert mock_used_socket.recv.mock_calls == [mocker.call(max_recv_size) for _ in range(3)] - assert mock_stream_data_consumer.feed.mock_calls == [mocker.call(b"pac"), mocker.call(b"ket"), mocker.call(b"\n")] + assert mock_used_socket.recv.call_args_list == [mocker.call(max_recv_size) for _ in range(3)] + assert mock_stream_data_consumer.feed.call_args_list == [mocker.call(b"pac"), mocker.call(b"ket"), mocker.call(b"\n")] assert packet is mocker.sentinel.packet else: with pytest.raises(TimeoutError, match=r"^recv_packet\(\) timed out$"): @@ -1751,11 +1751,11 @@ def test____recv_packet____timeout( _ = client.recv_packet(timeout=recv_timeout) if recv_timeout == 0: - assert len(mock_used_socket.recv.mock_calls) == 1 + assert len(mock_used_socket.recv.call_args_list) == 1 mock_selector_register.assert_not_called() mock_selector_select.assert_not_called() else: - assert len(mock_used_socket.recv.mock_calls) == 2 + assert len(mock_used_socket.recv.call_args_list) == 2 mock_selector_register.assert_called_with(mock_used_socket, EVENT_READ) mock_selector_select.assert_any_call(recv_timeout) mock_stream_data_consumer.feed.assert_not_called() @@ -1796,8 +1796,8 @@ def test____iter_received_packets____yields_available_packets_with_given_timeout packets = list(client.iter_received_packets(timeout=recv_timeout)) # Assert - assert mock_used_socket.recv.mock_calls == [mocker.call(max_recv_size) for _ in range(7)] - assert mock_stream_data_consumer.feed.mock_calls == [ + assert mock_used_socket.recv.call_args_list == [mocker.call(max_recv_size) for _ in range(7)] + assert mock_stream_data_consumer.feed.call_args_list == [ mocker.call(b"pac"), mocker.call(b"ket"), mocker.call(b"_1\np"), @@ -1825,8 +1825,8 @@ def test____iter_received_packets____yields_available_packets_until_eof( packets = list(client.iter_received_packets(timeout=recv_timeout)) # Assert - assert mock_used_socket.recv.mock_calls == [mocker.call(max_recv_size) for _ in range(7)] - assert mock_stream_data_consumer.feed.mock_calls == [ + assert mock_used_socket.recv.call_args_list == [mocker.call(max_recv_size) for _ in range(7)] + assert mock_stream_data_consumer.feed.call_args_list == [ mocker.call(b"pac"), mocker.call(b"ket"), mocker.call(b"_1\np"), @@ -1854,8 +1854,8 @@ def test____iter_received_packets____yields_available_packets_until_error( packets = list(client.iter_received_packets(timeout=recv_timeout)) # Assert - assert mock_used_socket.recv.mock_calls == [mocker.call(max_recv_size) for _ in range(7)] - assert mock_stream_data_consumer.feed.mock_calls == [ + assert mock_used_socket.recv.call_args_list == [mocker.call(max_recv_size) for _ in range(7)] + assert mock_stream_data_consumer.feed.call_args_list == [ mocker.call(b"pac"), mocker.call(b"ket"), mocker.call(b"_1\np"), diff --git a/tests/unit_test/test_sync/test_client/test_udp.py b/tests/unit_test/test_sync/test_client/test_udp.py index ec839575..150034d2 100644 --- a/tests/unit_test/test_sync/test_client/test_udp.py +++ b/tests/unit_test/test_sync/test_client/test_udp.py @@ -545,13 +545,13 @@ def test____send_packet_to____send_bytes_to_socket____without_remote____blocking if send_timeout != 0: mock_selector_register.assert_called_once_with(mock_udp_socket, EVENT_WRITE) mock_selector_select.assert_called_once_with(None if send_timeout in (None, float("+inf")) else send_timeout) - assert mock_udp_socket.sendto.mock_calls == [mocker.call(b"packet", target_address) for _ in range(2)] + assert mock_udp_socket.sendto.call_args_list == [mocker.call(b"packet", target_address) for _ in range(2)] mock_datagram_protocol.make_datagram.assert_called_once_with(mocker.sentinel.packet) mock_udp_socket.getsockopt.assert_called_once_with(SOL_SOCKET, SO_ERROR) else: mock_selector_register.assert_not_called() mock_selector_select.assert_not_called() - assert mock_udp_socket.sendto.mock_calls == [mocker.call(b"packet", target_address)] + assert mock_udp_socket.sendto.call_args_list == [mocker.call(b"packet", target_address)] mock_datagram_protocol.make_datagram.assert_called_once_with(mocker.sentinel.packet) mock_udp_socket.getsockopt.assert_not_called() @@ -636,13 +636,13 @@ def test____send_packet_to____send_bytes_to_socket____with_remote____blocking_op if send_timeout != 0: mock_selector_register.assert_called_once_with(mock_udp_socket, EVENT_WRITE) mock_selector_select.assert_called_once_with(None if send_timeout in (None, float("+inf")) else send_timeout) - assert mock_udp_socket.send.mock_calls == [mocker.call(b"packet") for _ in range(2)] + assert mock_udp_socket.send.call_args_list == [mocker.call(b"packet") for _ in range(2)] mock_datagram_protocol.make_datagram.assert_called_once_with(mocker.sentinel.packet) mock_udp_socket.getsockopt.assert_called_once_with(SOL_SOCKET, SO_ERROR) else: mock_selector_register.assert_not_called() mock_selector_select.assert_not_called() - assert mock_udp_socket.send.mock_calls == [mocker.call(b"packet")] + assert mock_udp_socket.send.call_args_list == [mocker.call(b"packet")] mock_datagram_protocol.make_datagram.assert_called_once_with(mocker.sentinel.packet) mock_udp_socket.getsockopt.assert_not_called() @@ -899,11 +899,11 @@ def test____recv_packet_from____no_block____timeout( _ = client.recv_packet_from(timeout=recv_timeout) if recv_timeout == 0: - assert len(mock_udp_socket.recvfrom.mock_calls) == 1 + assert len(mock_udp_socket.recvfrom.call_args_list) == 1 mock_selector_register.assert_not_called() mock_selector_select.assert_not_called() else: - assert len(mock_udp_socket.recvfrom.mock_calls) == 2 + assert len(mock_udp_socket.recvfrom.call_args_list) == 2 mock_selector_register.assert_called_with(mock_udp_socket, EVENT_READ) mock_selector_select.assert_any_call(recv_timeout) mock_datagram_protocol.build_packet_from_datagram.assert_not_called() @@ -938,8 +938,8 @@ def test____iter_received_packets_from____yields_available_packets_with_given_ti packets = [(p, (s.host, s.port)) for p, s in client.iter_received_packets_from(timeout=recv_timeout)] # Assert - assert mock_udp_socket.recvfrom.mock_calls == [mocker.call(MAX_DATAGRAM_BUFSIZE) for _ in range(3)] - assert mock_datagram_protocol.build_packet_from_datagram.mock_calls == [ + assert mock_udp_socket.recvfrom.call_args_list == [mocker.call(MAX_DATAGRAM_BUFSIZE) for _ in range(3)] + assert mock_datagram_protocol.build_packet_from_datagram.call_args_list == [ mocker.call(b"packet_1"), mocker.call(b"packet_2"), ] @@ -969,8 +969,8 @@ def test____iter_received_packets_from____yields_available_packets_until_error( packets = [(p, (s.host, s.port)) for p, s in client.iter_received_packets_from(timeout=recv_timeout)] # Assert - assert mock_udp_socket.recvfrom.mock_calls == [mocker.call(MAX_DATAGRAM_BUFSIZE) for _ in range(3)] - assert mock_datagram_protocol.build_packet_from_datagram.mock_calls == [ + assert mock_udp_socket.recvfrom.call_args_list == [mocker.call(MAX_DATAGRAM_BUFSIZE) for _ in range(3)] + assert mock_datagram_protocol.build_packet_from_datagram.call_args_list == [ mocker.call(b"packet_1"), mocker.call(b"packet_2"), ] @@ -1509,7 +1509,7 @@ def test____create_udp_socket____first_failed( # Assert assert udp_socket is mock_socket_ipv6 - assert mock_socket_cls.mock_calls == [ + assert mock_socket_cls.call_args_list == [ mocker.call(AF_INET, SOCK_DGRAM, IPPROTO_UDP), mocker.call(AF_INET6, SOCK_DGRAM, IPPROTO_UDP), ] @@ -1580,7 +1580,7 @@ def test____create_udp_socket____all_failed( assert all(isinstance(exc, OSError) for exc in os_errors.exceptions) del os_errors - assert mock_socket_cls.mock_calls == [ + assert mock_socket_cls.call_args_list == [ mocker.call(AF_INET, SOCK_DGRAM, IPPROTO_UDP), mocker.call(AF_INET6, SOCK_DGRAM, IPPROTO_UDP), ]