From 6d8636cbe83e29d05f1628bf409fe0a5efad01ae Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Wed, 23 Nov 2016 19:32:24 -0500 Subject: [PATCH] win: Skip tests that are known not to work on windows --- tests/test_pipes.py | 1 + tests/test_process.py | 4 ++++ tests/test_signals.py | 1 + tests/test_unix.py | 2 ++ uvloop/_testbase.py | 7 +++++++ 5 files changed, 15 insertions(+) diff --git a/tests/test_pipes.py b/tests/test_pipes.py index 8bec52b..9e23d7b 100644 --- a/tests/test_pipes.py +++ b/tests/test_pipes.py @@ -62,6 +62,7 @@ class MyWritePipeProto(asyncio.BaseProtocol): self.done.set_result(None) +@tb.skip_windows class _BasePipeTest: def test_read_pipe(self): proto = MyReadPipeProto(loop=self.loop) diff --git a/tests/test_process.py b/tests/test_process.py index 4d26ba2..2221896 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -527,6 +527,7 @@ class _AsyncioTests: test_utils.run_briefly(self.loop) +@tb.skip_windows # XXX tests will have to be fixed later class Test_UV_Process(_TestProcess, tb.UVTestCase): def test_process_streams_redirect(self): @@ -563,14 +564,17 @@ print('err', file=sys.stderr, flush=True) self.assertEqual(se.read(), b'err\n') +@tb.skip_windows # Some tests fail under asyncio class Test_AIO_Process(_TestProcess, tb.AIOTestCase): pass +@tb.skip_windows # XXX tests will have to be fixed later class TestAsyncio_UV_Process(_AsyncioTests, tb.UVTestCase): pass +@tb.skip_windows # Some tests fail under asyncio class TestAsyncio_AIO_Process(_AsyncioTests, tb.AIOTestCase): pass diff --git a/tests/test_signals.py b/tests/test_signals.py index b92e74f..517f4df 100644 --- a/tests/test_signals.py +++ b/tests/test_signals.py @@ -9,6 +9,7 @@ from uvloop import _testbase as tb DELAY = 0.1 +@tb.skip_windows class _TestSignal: NEW_LOOP = None diff --git a/tests/test_unix.py b/tests/test_unix.py index 10daf6a..2985fa5 100644 --- a/tests/test_unix.py +++ b/tests/test_unix.py @@ -9,6 +9,7 @@ import unittest from uvloop import _testbase as tb +@tb.skip_windows class _TestUnix: def test_create_unix_server_1(self): CNT = 0 # number of clients that were successful @@ -453,6 +454,7 @@ class Test_AIO_Unix(_TestUnix, tb.AIOTestCase): pass +@tb.skip_windows class _TestSSL(tb.SSLTestCase): ONLYCERT = tb._cert_fullname(__file__, 'ssl_cert.pem') diff --git a/uvloop/_testbase.py b/uvloop/_testbase.py index 87a833a..a645645 100644 --- a/uvloop/_testbase.py +++ b/uvloop/_testbase.py @@ -12,6 +12,7 @@ import re import select import socket import ssl +import sys import tempfile import threading import time @@ -19,6 +20,12 @@ import unittest import uvloop +def skip_windows(o): + dec = unittest.skipIf(sys.platform in ('win32', 'cygwin', 'cli'), + 'skipped on Windows') + return dec(o) + + class MockPattern(str): def __eq__(self, other): return bool(re.search(str(self), other, re.S))