Skip two tests that are flaky on Windows
These tests tend to throw WinError 10053, 10054 and 10061 on Windows,
which breaks the continuous integration most of the time. Since we're
not testing anything Windows-specific here, it's okay to not run those
tests on Windows.
MODIFY
test/__init__.py
test/__init__.py
@@ -143,6 +143,19 @@ def notPyPy2(test):
return wrapper
+def notWindows(test):
+ """Skips this test on Windows"""
+
+ @six.wraps(test)
+ def wrapper(*args, **kwargs):
+ msg = "{} is flaky on Windows".format(test.__name__)
+ if platform.system() == "Windows":
+ pytest.skip(msg)
+ return test(*args, **kwargs)
+
+ return wrapper
+
+
def onlyBrotlipy():
return pytest.mark.skipif(brotli is None, reason="only run if brotlipy is present")

MODIFY
test/with_dummyserver/test_chunked_transfer.py
test/with_dummyserver/test_chunked_transfer.py
@@ -6,6 +6,7 @@ from urllib3 import HTTPConnectionPool
from urllib3.util.retry import Retry
from urllib3.util import SUPPRESS_USER_AGENT
from dummyserver.testcase import SocketDummyServerTestCase, consume_socket
+from test import notWindows
# Retry failed tests
pytestmark = pytest.mark.flaky
@@ -155,6 +156,7 @@ class TestChunkedTransfer(SocketDummyServerTestCase):
sock.close()
assert self.chunked_requests == 2
+ @notWindows
def test_preserve_chunked_on_redirect(self):
self.chunked_requests = 0
@@ -182,6 +184,7 @@ class TestChunkedTransfer(SocketDummyServerTestCase):
)
assert self.chunked_requests == 2
+ @notWindows
def test_preserve_chunked_on_broken_connection(self):
self.chunked_requests = 0

Skip two tests that are flaky on Windows

These tests tend to throw WinError 10053, 10054 and 10061 on Windows,
which breaks the continuous integration most of the time. Since we're
not testing anything Windows-specific here, it's okay to not run those
tests on Windows.