From a31e808b1f35190c3875645e40d5bc31a6f3a950 Mon Sep 17 00:00:00 2001 From: Kevin Tindall Date: Wed, 8 Dec 2021 17:58:41 -0600 Subject: [PATCH] Skip some more things on Windows --- mcstatus/tests/test_timeout.py | 9 +++++---- tox.ini | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mcstatus/tests/test_timeout.py b/mcstatus/tests/test_timeout.py index d95f36e..1c1b50e 100644 --- a/mcstatus/tests/test_timeout.py +++ b/mcstatus/tests/test_timeout.py @@ -1,13 +1,13 @@ -import asyncio -from asyncio import StreamReader +from mock import patch +import sys +import asyncio import pytest -from mock import patch from mcstatus.protocol.connection import TCPAsyncSocketConnection -class FakeAsyncStream(StreamReader): +class FakeAsyncStream(asyncio.StreamReader): async def read(self, n: int) -> bytes: await asyncio.sleep(delay=2) return bytes([0] * n) @@ -17,6 +17,7 @@ def fake_asyncio_asyncio_open_connection(hostname, port): return FakeAsyncStream(), None +@pytest.mark.skipif(sys.platform.startswith("win"), reason="async bug on Windows https://github.com/Dinnerbone/mcstatus/issues/140") class TestAsyncSocketConnection: def setup_method(self): self.tcp_async_socket = TCPAsyncSocketConnection() diff --git a/tox.ini b/tox.ini index dfedef0..5bc1212 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ commands = pytest {posargs} [testenv:check] +platform = linux2|darwin commands = black --check -l 127 ./mcstatus pytype ./mcstatus