Skip to content

Commit 564cd57

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent e636aca commit 564cd57

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
10021002
def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
10031003
# Test that the proxy environment variables are set correctly
10041004
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1005+
# Delete in case our environment has this set
1006+
monkeypatch.delenv("HTTP_PROXY", raising=False)
10051007

10061008
client = DefaultHttpxClient()
10071009

@@ -1953,6 +1955,8 @@ async def test_get_platform(self) -> None:
19531955
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19541956
# Test that the proxy environment variables are set correctly
19551957
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1958+
# Delete in case our environment has this set
1959+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19561960

19571961
client = DefaultAsyncHttpxClient()
19581962

0 commit comments

Comments
 (0)