diff --git a/mcstatus/tests/test_server.py b/mcstatus/tests/test_server.py index 2167527..5080052 100644 --- a/mcstatus/tests/test_server.py +++ b/mcstatus/tests/test_server.py @@ -8,6 +8,8 @@ class MockProtocolFactory(asyncio.Protocol): + transport: asyncio.Transport + def __init__(self, data_expected_to_receive, data_to_respond_with): self.data_expected_to_receive = data_expected_to_receive self.data_to_respond_with = data_to_respond_with diff --git a/mcstatus/tests/test_timeout.py b/mcstatus/tests/test_timeout.py index ffcb692..d95f36e 100644 --- a/mcstatus/tests/test_timeout.py +++ b/mcstatus/tests/test_timeout.py @@ -8,7 +8,7 @@ class FakeAsyncStream(StreamReader): - async def read(self, n: int = ...) -> bytes: + async def read(self, n: int) -> bytes: await asyncio.sleep(delay=2) return bytes([0] * n) @@ -30,7 +30,7 @@ def test_tcp_socket_read(self): loop = asyncio.get_event_loop() with patch("asyncio.open_connection") as open_conn: open_conn.return_value = (FakeAsyncStream(), None) - loop.run_until_complete(self.tcp_async_socket.connect('dummy_address', timeout=0.01)) + loop.run_until_complete(self.tcp_async_socket.connect("dummy_address", timeout=0.01)) with pytest.raises(TimeoutError): loop.run_until_complete(self.tcp_async_socket.read(10))