Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the proxy.py test dep to v3.4.0 #6176

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pluggy==0.13.1
# pytest
pre-commit==2.15.0
# via -r requirements/lint.txt
proxy.py==2.3.1
proxy.py==3.4.0
# via -r requirements/test.txt
py==1.10.0
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cryptography==3.3.1; platform_machine!="i686" and python_version<"3.9" # no 32-b
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==3.4.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was supposed to be v2.4.0 but it's already proxy.py ~= 2.4.4rc3.

pytest==6.2.5
pytest-cov==3.0.0
pytest-mock==3.6.1
Expand Down
13 changes: 3 additions & 10 deletions tests/test_proxy_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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.
Expand All @@ -54,18 +54,11 @@ def secure_proxy_url(monkeypatch, tls_certificate_pem_path):
tls_certificate_pem_path, # contains both key and cert
]

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=proxy_instance.pool.flags.hostname,
port=proxy_instance.pool.flags.port,
)


Expand Down