Move IPv6 test skips in server fixtures
MODIFY
test/conftest.py
test/conftest.py
@@ -16,6 +16,7 @@ from dummyserver.server import (
CLIENT_INTERMEDIATE_PEM,
CLIENT_NO_INTERMEDIATE_PEM,
CLIENT_INTERMEDIATE_KEY,
+ HAS_IPV6,
)
@@ -100,6 +101,9 @@ def ip_san_server(tmp_path_factory):
@pytest.fixture
def ipv6_addr_server(tmp_path_factory):
+ if not HAS_IPV6:
+ pytest.skip("Only runs on IPv6 systems")
+
tmpdir = tmp_path_factory.mktemp("certs")
ca = trustme.CA()
# IP address in Common Name
@@ -111,6 +115,9 @@ def ipv6_addr_server(tmp_path_factory):
@pytest.fixture
def ipv6_san_server(tmp_path_factory):
+ if not HAS_IPV6:
+ pytest.skip("Only runs on IPv6 systems")
+
tmpdir = tmp_path_factory.mktemp("certs")
ca = trustme.CA()
# IP address in Subject Alternative Name

MODIFY
test/with_dummyserver/test_https.py
test/with_dummyserver/test_https.py
@@ -18,7 +18,6 @@ from dummyserver.server import (
DEFAULT_CA,
DEFAULT_CA_BAD,
DEFAULT_CERTS,
- HAS_IPV6,
PASSWORD_CLIENT_KEYFILE,
)
@@ -735,7 +734,6 @@ class TestHTTPS_IPSAN:
class TestHTTPS_IPv6Addr:
- @pytest.mark.skipif(not HAS_IPV6, reason="Only runs on IPv6 systems")
def test_strip_square_brackets_before_validating(self, ipv6_addr_server):
"""Test that the fix for #760 works."""
with HTTPSConnectionPool(
@@ -749,7 +747,6 @@ class TestHTTPS_IPv6Addr:
class TestHTTPS_IPV6SAN:
- @pytest.mark.skipif(not HAS_IPV6, reason="Only runs on IPv6 systems")
def test_can_validate_ipv6_san(self, ipv6_san_server):
"""Ensure that urllib3 can validate SANs with IPv6 addresses in them."""
try:

Move IPv6 test skips in server fixtures