Don't try to run IPv6 tests if IPv6 is disabled at runtime
@@ -10,6 +10,7 @@ from dummyserver.server import (
run_tornado_app,
run_loop_in_thread,
DEFAULT_CERTS,
+ HAS_IPV6,
)
from dummyserver.handlers import TestingApp
from dummyserver.proxy import ProxyHandler
@@ -134,7 +135,7 @@ class HTTPSDummyServerTestCase(HTTPDummyServerTestCase):
certs = DEFAULT_CERTS
-@pytest.mark.skipif(not socket.has_ipv6, reason='IPv6 not available')
+@pytest.mark.skipif(not HAS_IPV6, reason='IPv6 not available')
class IPV6HTTPSDummyServerTestCase(HTTPSDummyServerTestCase):
host = '::1'
@@ -178,7 +179,7 @@ class HTTPDummyProxyTestCase(unittest.TestCase):
cls.server_thread.join()
-@pytest.mark.skipif(not socket.has_ipv6, reason='IPv6 not available')
+@pytest.mark.skipif(not HAS_IPV6, reason='IPv6 not available')
class IPv6HTTPDummyServerTestCase(HTTPDummyServerTestCase):
host = '::1'
