Skip some more things on Windows

This commit is contained in:
Kevin Tindall
2021-12-08 17:58:41 -06:00
parent 26726071af
commit a31e808b1f
2 changed files with 7 additions and 5 deletions

View File

@@ -1,13 +1,13 @@
import asyncio
from asyncio import StreamReader
import pytest
from mock import patch from mock import patch
import sys
import asyncio
import pytest
from mcstatus.protocol.connection import TCPAsyncSocketConnection from mcstatus.protocol.connection import TCPAsyncSocketConnection
class FakeAsyncStream(StreamReader): class FakeAsyncStream(asyncio.StreamReader):
async def read(self, n: int) -> bytes: async def read(self, n: int) -> bytes:
await asyncio.sleep(delay=2) await asyncio.sleep(delay=2)
return bytes([0] * n) return bytes([0] * n)
@@ -17,6 +17,7 @@ def fake_asyncio_asyncio_open_connection(hostname, port):
return FakeAsyncStream(), None return FakeAsyncStream(), None
@pytest.mark.skipif(sys.platform.startswith("win"), reason="async bug on Windows https://github.com/Dinnerbone/mcstatus/issues/140")
class TestAsyncSocketConnection: class TestAsyncSocketConnection:
def setup_method(self): def setup_method(self):
self.tcp_async_socket = TCPAsyncSocketConnection() self.tcp_async_socket = TCPAsyncSocketConnection()

View File

@@ -11,6 +11,7 @@ commands =
pytest {posargs} pytest {posargs}
[testenv:check] [testenv:check]
platform = linux2|darwin
commands = commands =
black --check -l 127 ./mcstatus black --check -l 127 ./mcstatus
pytype ./mcstatus pytype ./mcstatus