Skip to content

Commit e33584f

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 977dcfa commit e33584f

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

10931095
client = DefaultHttpxClient()
10941096

@@ -2131,6 +2133,8 @@ async def test_get_platform(self) -> None:
21312133
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
21322134
# Test that the proxy environment variables are set correctly
21332135
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
2136+
# Delete in case our environment has this set
2137+
monkeypatch.delenv("HTTP_PROXY", raising=False)
21342138

21352139
client = DefaultAsyncHttpxClient()
21362140

0 commit comments

Comments
 (0)