Skip to content

Commit

Permalink
Drop xfails for CPython 3.13.0a5
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-v authored and sethmlarson committed Apr 12, 2024
1 parent c9f8d39 commit b7c2910
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions test/with_dummyserver/test_proxy_poolmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import shutil
import socket
import ssl
import sys
import tempfile
from test import LONG_TIMEOUT, SHORT_TIMEOUT, resolvesLocalhostFQDN, withPyOpenSSL
from test.conftest import ServerConfig
Expand Down Expand Up @@ -43,11 +42,6 @@

from .. import TARPIT_HOST, requires_network

_broken_on_python313a5 = pytest.mark.xfail(
sys.version_info == (3, 13, 0, "alpha", 5),
reason="https://github.com/python/cpython/issues/116764",
)


def assert_is_verified(pm: ProxyManager, *, proxy: bool, target: bool) -> None:
pool = list(pm.pools._container.values())[-1] # retrieve last pool entry
Expand Down Expand Up @@ -83,7 +77,6 @@ def teardown_class(cls) -> None:
super().teardown_class()
shutil.rmtree(cls.certs_dir)

@_broken_on_python313a5
def test_basic_proxy(self) -> None:
with proxy_from_url(self.proxy_url, ca_certs=DEFAULT_CA) as http:
r = http.request("GET", f"{self.http_url}/")
Expand All @@ -92,7 +85,6 @@ def test_basic_proxy(self) -> None:
r = http.request("GET", f"{self.https_url}/")
assert r.status == 200

@_broken_on_python313a5
def test_https_proxy(self) -> None:
with proxy_from_url(self.https_proxy_url, ca_certs=DEFAULT_CA) as https:
r = https.request("GET", f"{self.https_url}/")
Expand All @@ -101,7 +93,6 @@ def test_https_proxy(self) -> None:
r = https.request("GET", f"{self.http_url}/")
assert r.status == 200

@_broken_on_python313a5
def test_is_verified_http_proxy_to_http_target(self) -> None:
with proxy_from_url(self.proxy_url, ca_certs=DEFAULT_CA) as http:
r = http.request("GET", f"{self.http_url}/")
Expand All @@ -114,7 +105,6 @@ def test_is_verified_http_proxy_to_https_target(self) -> None:
assert r.status == 200
assert_is_verified(http, proxy=False, target=True)

@_broken_on_python313a5
def test_is_verified_https_proxy_to_http_target(self) -> None:
with proxy_from_url(self.https_proxy_url, ca_certs=DEFAULT_CA) as https:
r = https.request("GET", f"{self.http_url}/")
Expand All @@ -127,7 +117,6 @@ def test_is_verified_https_proxy_to_https_target(self) -> None:
assert r.status == 200
assert_is_verified(https, proxy=True, target=True)

@_broken_on_python313a5
def test_http_and_https_kwarg_ca_cert_data_proxy(self) -> None:
with open(DEFAULT_CA) as pem_file:
pem_file_data = pem_file.read()
Expand All @@ -138,7 +127,6 @@ def test_http_and_https_kwarg_ca_cert_data_proxy(self) -> None:
r = https.request("GET", f"{self.http_url}/")
assert r.status == 200

@_broken_on_python313a5
def test_https_proxy_with_proxy_ssl_context(self) -> None:
proxy_ssl_context = create_urllib3_context()
proxy_ssl_context.load_verify_locations(DEFAULT_CA)
Expand All @@ -154,7 +142,6 @@ def test_https_proxy_with_proxy_ssl_context(self) -> None:
assert r.status == 200

@withPyOpenSSL
@_broken_on_python313a5
def test_https_proxy_pyopenssl_not_supported(self) -> None:
with proxy_from_url(self.https_proxy_url, ca_certs=DEFAULT_CA) as https:
r = https.request("GET", f"{self.http_url}/")
Expand All @@ -165,7 +152,6 @@ def test_https_proxy_pyopenssl_not_supported(self) -> None:
):
https.request("GET", f"{self.https_url}/")

@_broken_on_python313a5
def test_https_proxy_forwarding_for_https(self) -> None:
with proxy_from_url(
self.https_proxy_url,
Expand All @@ -178,7 +164,6 @@ def test_https_proxy_forwarding_for_https(self) -> None:
r = https.request("GET", f"{self.https_url}/")
assert r.status == 200

@_broken_on_python313a5
def test_nagle_proxy(self) -> None:
"""Test that proxy connections do not have TCP_NODELAY turned on"""
with ProxyManager(self.proxy_url) as http:
Expand Down Expand Up @@ -217,7 +202,6 @@ def test_proxy_conn_fail_from_dns(
e.value.reason.original_error, urllib3.exceptions.NameResolutionError
)

@_broken_on_python313a5
def test_oldapi(self) -> None:
with ProxyManager(
connection_from_url(self.proxy_url), ca_certs=DEFAULT_CA # type: ignore[arg-type]
Expand Down Expand Up @@ -274,7 +258,6 @@ def test_proxy_verified(self) -> None:
https_fail_pool.request("GET", "/", retries=0)
assert isinstance(e.value.reason, SSLError)

@_broken_on_python313a5
def test_redirect(self) -> None:
with proxy_from_url(self.proxy_url) as http:
r = http.request(
Expand All @@ -295,7 +278,6 @@ def test_redirect(self) -> None:
assert r.status == 200
assert r.data == b"Dummy server!"

@_broken_on_python313a5
def test_cross_host_redirect(self) -> None:
with proxy_from_url(self.proxy_url) as http:
cross_host_location = f"{self.http_url_alt}/echo?a=b"
Expand All @@ -317,7 +299,6 @@ def test_cross_host_redirect(self) -> None:
assert r._pool is not None
assert r._pool.host != self.http_host_alt

@_broken_on_python313a5
def test_cross_protocol_redirect(self) -> None:
with proxy_from_url(self.proxy_url, ca_certs=DEFAULT_CA) as http:
cross_protocol_location = f"{self.https_url}/echo?a=b"
Expand All @@ -339,7 +320,6 @@ def test_cross_protocol_redirect(self) -> None:
assert r._pool is not None
assert r._pool.host == self.https_host

@_broken_on_python313a5
def test_headers(self) -> None:
with proxy_from_url(
self.proxy_url,
Expand Down Expand Up @@ -415,7 +395,6 @@ def test_headers(self) -> None:
returned_headers.get("Host") == f"{self.https_host}:{self.https_port}"
)

@_broken_on_python313a5
def test_https_headers(self) -> None:
with proxy_from_url(
self.https_proxy_url,
Expand Down Expand Up @@ -448,7 +427,6 @@ def test_https_headers(self) -> None:
returned_headers.get("Host") == f"{self.https_host}:{self.https_port}"
)

@_broken_on_python313a5
def test_https_headers_forwarding_for_https(self) -> None:
with proxy_from_url(
self.https_proxy_url,
Expand All @@ -465,7 +443,6 @@ def test_https_headers_forwarding_for_https(self) -> None:
returned_headers.get("Host") == f"{self.https_host}:{self.https_port}"
)

@_broken_on_python313a5
def test_headerdict(self) -> None:
default_headers = HTTPHeaderDict(a="b")
proxy_headers = HTTPHeaderDict()
Expand Down Expand Up @@ -523,10 +500,6 @@ def test_proxy_pooling_ext(self) -> None:
assert sc3 == sc4

@requires_network()
@pytest.mark.xfail(
sys.version_info == (3, 13, 0, "alpha", 5) and sys.platform == "win32",
reason="https://github.com/python/cpython/issues/116764",
)
@pytest.mark.parametrize(
["proxy_scheme", "target_scheme", "use_forwarding_for_https"],
[
Expand Down Expand Up @@ -695,7 +668,6 @@ def test_proxy_https_target_tls_error(
# stdlib http.client.HTTPConnection._tunnel() causes a ResourceWarning
# see https://github.com/python/cpython/issues/103472
@pytest.mark.filterwarnings("default::ResourceWarning")
@_broken_on_python313a5
def test_scheme_host_case_insensitive(self) -> None:
"""Assert that upper-case schemes and hosts are normalized."""
with proxy_from_url(self.proxy_url.upper(), ca_certs=DEFAULT_CA) as http:
Expand Down Expand Up @@ -744,7 +716,6 @@ def setup_class(cls) -> None:
# stdlib http.client.HTTPConnection._tunnel() causes a ResourceWarning
# see https://github.com/python/cpython/issues/103472
@pytest.mark.filterwarnings("default::ResourceWarning")
@_broken_on_python313a5
def test_basic_ipv6_proxy(self) -> None:
with proxy_from_url(self.proxy_url, ca_certs=DEFAULT_CA) as http:
r = http.request("GET", f"{self.http_url}/")
Expand Down Expand Up @@ -779,7 +750,6 @@ def _get_certificate_formatted_proxy_host(host: str) -> str:
# stdlib http.client.HTTPConnection._tunnel() causes a ResourceWarning
# see https://github.com/python/cpython/issues/103472
@pytest.mark.filterwarnings("default::ResourceWarning")
@_broken_on_python313a5
def test_https_proxy_assert_fingerprint_md5(
self, no_san_proxy_with_server: tuple[ServerConfig, ServerConfig]
) -> None:
Expand Down Expand Up @@ -822,7 +792,6 @@ def test_https_proxy_assert_fingerprint_md5_non_matching(
# stdlib http.client.HTTPConnection._tunnel() causes a ResourceWarning
# see https://github.com/python/cpython/issues/103472
@pytest.mark.filterwarnings("default::ResourceWarning")
@_broken_on_python313a5
def test_https_proxy_assert_hostname(
self, san_proxy_with_server: tuple[ServerConfig, ServerConfig]
) -> None:
Expand All @@ -840,11 +809,6 @@ def test_https_proxy_assert_hostname(
def test_https_proxy_assert_hostname_non_matching(
self, san_proxy_with_server: tuple[ServerConfig, ServerConfig]
) -> None:
if (
sys.version_info == (3, 13, 0, "alpha", 5)
and san_proxy_with_server[0].host == "::1"
):
pytest.xfail(reason="https://github.com/python/cpython/issues/116764")
proxy, server = san_proxy_with_server
destination_url = f"https://{server.host}:{server.port}"

Expand Down Expand Up @@ -896,7 +860,6 @@ def test_https_proxy_hostname_verification(
# stdlib http.client.HTTPConnection._tunnel() causes a ResourceWarning
# see https://github.com/python/cpython/issues/103472
@pytest.mark.filterwarnings("default::ResourceWarning")
@_broken_on_python313a5
def test_https_proxy_ipv4_san(
self, ipv4_san_proxy_with_server: tuple[ServerConfig, ServerConfig]
) -> None:
Expand All @@ -907,7 +870,6 @@ def test_https_proxy_ipv4_san(
r = https.request("GET", destination_url)
assert r.status == 200

@_broken_on_python313a5
def test_https_proxy_ipv6_san(
self, ipv6_san_proxy_with_server: tuple[ServerConfig, ServerConfig]
) -> None:
Expand Down Expand Up @@ -941,7 +903,6 @@ def test_https_proxy_no_san(
ssl_error
)

@_broken_on_python313a5
def test_https_proxy_no_san_hostname_checks_common_name(
self, no_san_proxy_with_server: tuple[ServerConfig, ServerConfig]
) -> None:
Expand Down

0 comments on commit b7c2910

Please sign in to comment.