(self)
| 71 | assert p._proxy_requires_url_absolute_form(https_url) |
| 72 | |
| 73 | def test_proxy_connect_retry(self) -> None: |
| 74 | retry = Retry(total=None, connect=False) |
| 75 | port = find_unused_port() |
| 76 | with ProxyManager(f"http://localhost:{port}") as p: |
| 77 | with pytest.raises(ProxyError) as ei: |
| 78 | p.urlopen("HEAD", url="http://localhost/", retries=retry) |
| 79 | assert isinstance(ei.value.original_error, NewConnectionError) |
| 80 | |
| 81 | retry = Retry(total=None, connect=2) |
| 82 | with ProxyManager(f"http://localhost:{port}") as p: |
| 83 | with pytest.raises(MaxRetryError) as ei1: |
| 84 | p.urlopen("HEAD", url="http://localhost/", retries=retry) |
| 85 | assert ei1.value.reason is not None |
| 86 | assert isinstance(ei1.value.reason, ProxyError) |
| 87 | assert isinstance(ei1.value.reason.original_error, NewConnectionError) |
nothing calls this directly
no test coverage detected