Skip to content

Commit

Permalink
Appease pytype and black
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkjt2000 committed Jul 7, 2021
1 parent 477f636 commit 7581c27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mcstatus/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mcstatus/tests/test_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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))

0 comments on commit 7581c27

Please sign in to comment.