Skip to content

Commit f7056e0

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent e1e2c6a commit f7056e0

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

10491051
client = DefaultHttpxClient()
10501052

@@ -2048,6 +2050,8 @@ async def test_get_platform(self) -> None:
20482050
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
20492051
# Test that the proxy environment variables are set correctly
20502052
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
2053+
# Delete in case our environment has this set
2054+
monkeypatch.delenv("HTTP_PROXY", raising=False)
20512055

20522056
client = DefaultAsyncHttpxClient()
20532057

0 commit comments

Comments
 (0)