Skip to content

Commit 2420dd3

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent fcf96d3 commit 2420dd3

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

988990
client = DefaultHttpxClient()
989991

@@ -1916,6 +1918,8 @@ async def test_get_platform(self) -> None:
19161918
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19171919
# Test that the proxy environment variables are set correctly
19181920
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1921+
# Delete in case our environment has this set
1922+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19191923

19201924
client = DefaultAsyncHttpxClient()
19211925

0 commit comments

Comments
 (0)