Skip to content

Commit 7bfaa75

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 7b43922 commit 7bfaa75

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

959961
client = DefaultHttpxClient()
960962

@@ -1912,6 +1914,8 @@ async def test_main() -> None:
19121914
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19131915
# Test that the proxy environment variables are set correctly
19141916
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1917+
# Delete in case our environment has this set
1918+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19151919

19161920
client = DefaultAsyncHttpxClient()
19171921

0 commit comments

Comments
 (0)