Skip to content

Commit

Permalink
Move IPv6 test skips in server fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Jan 16, 2020
1 parent d44f0e5 commit d2a5a59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions test/conftest.py
Expand Up @@ -16,6 +16,7 @@
CLIENT_INTERMEDIATE_PEM,
CLIENT_NO_INTERMEDIATE_PEM,
CLIENT_INTERMEDIATE_KEY,
HAS_IPV6,
)


Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions test/with_dummyserver/test_https.py
Expand Up @@ -18,7 +18,6 @@
DEFAULT_CA,
DEFAULT_CA_BAD,
DEFAULT_CERTS,
HAS_IPV6,
PASSWORD_CLIENT_KEYFILE,
)

Expand Down Expand Up @@ -735,7 +734,6 @@ def test_can_validate_ip_san(self, ip_san_server):


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(
Expand All @@ -749,7 +747,6 @@ def test_strip_square_brackets_before_validating(self, ipv6_addr_server):


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:
Expand Down

0 comments on commit d2a5a59

Please sign in to comment.