Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1f2227a

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

File tree

1 file changed

+14
-2
lines changed
  • tests
    • test_client.py

1 file changed

+14
-2
lines changed

tests/test_client.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
10031003
def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
10041004
# Test that the proxy environment variables are set correctly
10051005
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1006-
# Delete in case our environment has this set
1006+
# Delete in case our environment has any proxy env vars set
10071007
monkeypatch.delenv("HTTP_PROXY", raising=False)
1008+
monkeypatch.delenv("ALL_PROXY", raising=False)
1009+
monkeypatch.delenv("NO_PROXY", raising=False)
1010+
monkeypatch.delenv("http_proxy", raising=False)
1011+
monkeypatch.delenv("https_proxy", raising=False)
1012+
monkeypatch.delenv("all_proxy", raising=False)
1013+
monkeypatch.delenv("no_proxy", raising=False)
10081014

10091015
client = DefaultHttpxClient()
10101016

@@ -1960,8 +1966,14 @@ async def test_get_platform(self) -> None:
19601966
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19611967
# Test that the proxy environment variables are set correctly
19621968
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1963-
# Delete in case our environment has this set
1969+
# Delete in case our environment has any proxy env vars set
19641970
monkeypatch.delenv("HTTP_PROXY", raising=False)
1971+
monkeypatch.delenv("ALL_PROXY", raising=False)
1972+
monkeypatch.delenv("NO_PROXY", raising=False)
1973+
monkeypatch.delenv("http_proxy", raising=False)
1974+
monkeypatch.delenv("https_proxy", raising=False)
1975+
monkeypatch.delenv("all_proxy", raising=False)
1976+
monkeypatch.delenv("no_proxy", raising=False)
19651977

19661978
client = DefaultAsyncHttpxClient()
19671979

0 commit comments

Comments
(0)