Skip to content

Commit 588d239

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 481ff6e commit 588d239

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
@@ -1036,6 +1036,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
10361036
def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
10371037
# Test that the proxy environment variables are set correctly
10381038
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1039+
# Delete in case our environment has this set
1040+
monkeypatch.delenv("HTTP_PROXY", raising=False)
10391041

10401042
client = DefaultHttpxClient()
10411043

@@ -2079,6 +2081,8 @@ async def test_get_platform(self) -> None:
20792081
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
20802082
# Test that the proxy environment variables are set correctly
20812083
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
2084+
# Delete in case our environment has this set
2085+
monkeypatch.delenv("HTTP_PROXY", raising=False)
20822086

20832087
client = DefaultAsyncHttpxClient()
20842088

0 commit comments

Comments
 (0)