From a61765bed3632021fdee87e2a8b92f8b37fbd9a5 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 5 Dec 2021 00:33:16 +0000 Subject: [PATCH] [PR #6380/674948f5 backport][3.9] Bump proxy.py to v2.4.0 pre-release (#6382) Co-authored-by: Andrew Svetlov Co-authored-by: Sviatoslav Sydorenko --- requirements/constraints.txt | 3 +-- requirements/test.txt | 2 +- tests/test_proxy_functional.py | 13 +++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 5a0b3c7656b..66a6b4d4809 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -130,7 +130,7 @@ pluggy==1.0.0 # via pytest pre-commit==2.16.0 # via -r requirements/lint.txt -proxy.py==2.3.1 +proxy.py==2.4.0rc2 # via -r requirements/test.txt py==1.11.0 # via pytest @@ -238,7 +238,6 @@ typing-extensions==3.7.4.3 # -r requirements/typing-extensions.txt # async-timeout # mypy - # proxy.py # pydantic uritemplate==4.1.1 # via gidgethub diff --git a/requirements/test.txt b/requirements/test.txt index ba092ba915b..c4fefd12198 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -5,7 +5,7 @@ cryptography==36.0.0; platform_machine!="i686" # no 32-bit wheels; no python 3.9 freezegun==1.1.0 mypy==0.910; implementation_name=="cpython" mypy-extensions==0.4.3; implementation_name=="cpython" -proxy.py==2.3.1 +proxy.py ~= 2.4.0a2 pytest==6.2.5 pytest-cov==3.0.0 pytest-mock==3.6.1 diff --git a/tests/test_proxy_functional.py b/tests/test_proxy_functional.py index 32dc4f6dc73..e27aac40d8d 100644 --- a/tests/test_proxy_functional.py +++ b/tests/test_proxy_functional.py @@ -33,7 +33,7 @@ @pytest.fixture -def secure_proxy_url(monkeypatch, tls_certificate_pem_path): +def secure_proxy_url(tls_certificate_pem_path): """Return the URL of an instance of a running secure proxy. This fixture also spawns that instance and tears it down after the test. @@ -53,18 +53,11 @@ def secure_proxy_url(monkeypatch, tls_certificate_pem_path): if not IS_MACOS and not IS_WINDOWS: proxypy_args.append("--threadless") # use asyncio - class PatchedAccetorPool(proxy.core.acceptor.AcceptorPool): - def listen(self): - super().listen() - self.socket_host, self.socket_port = self.socket.getsockname()[:2] - - monkeypatch.setattr(proxy.proxy, "AcceptorPool", PatchedAccetorPool) - with proxy.Proxy(input_args=proxypy_args) as proxy_instance: yield URL.build( scheme="https", - host=proxy_instance.acceptors.socket_host, - port=proxy_instance.acceptors.socket_port, + host=str(proxy_instance.flags.hostname), + port=proxy_instance.flags.port, )