Skip to content

Commit 428cd95

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent a60c8e4 commit 428cd95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_client.py

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

10321034
client = DefaultHttpxClient()
10331035

@@ -2015,6 +2017,8 @@ async def test_get_platform(self) -> None:
20152017
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
20162018
# Test that the proxy environment variables are set correctly
20172019
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
2020+
# Delete in case our environment has this set
2021+
monkeypatch.delenv("HTTP_PROXY", raising=False)
20182022

20192023
client = DefaultAsyncHttpxClient()
20202024

0 commit comments

Comments
 (0)