Visitar URL original
chore(internal): make `test_proxy_environment_variables` more resilie… · unlayer/unlayer-python@caea803 · GitHub
Skip to content

Commit caea803

Browse files
chore(internal): make test_proxy_environment_variables more resilient to env
1 parent f10d12b commit caea803

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎tests/test_client.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
927927
def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
928928
# Test that the proxy environment variables are set correctly
929929
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
930-
# Delete in case our environment has this set
930+
# Delete in case our environment has any proxy env vars set
931931
monkeypatch.delenv("HTTP_PROXY", raising=False)
932+
monkeypatch.delenv("ALL_PROXY", raising=False)
933+
monkeypatch.delenv("NO_PROXY", raising=False)
934+
monkeypatch.delenv("http_proxy", raising=False)
935+
monkeypatch.delenv("https_proxy", raising=False)
936+
monkeypatch.delenv("all_proxy", raising=False)
937+
monkeypatch.delenv("no_proxy", raising=False)
932938

933939
client = DefaultHttpxClient()
934940

@@ -1821,8 +1827,14 @@ async def test_get_platform(self) -> None:
18211827
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18221828
# Test that the proxy environment variables are set correctly
18231829
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1824-
# Delete in case our environment has this set
1830+
# Delete in case our environment has any proxy env vars set
18251831
monkeypatch.delenv("HTTP_PROXY", raising=False)
1832+
monkeypatch.delenv("ALL_PROXY", raising=False)
1833+
monkeypatch.delenv("NO_PROXY", raising=False)
1834+
monkeypatch.delenv("http_proxy", raising=False)
1835+
monkeypatch.delenv("https_proxy", raising=False)
1836+
monkeypatch.delenv("all_proxy", raising=False)
1837+
monkeypatch.delenv("no_proxy", raising=False)
18261838

18271839
client = DefaultAsyncHttpxClient()
18281840

0 commit comments

Comments
 (0)