Skip to content

Commit b768b4f

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 0451d35 commit b768b4f

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

965967
client = DefaultHttpxClient()
966968

@@ -1873,6 +1875,8 @@ async def test_get_platform(self) -> None:
18731875
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18741876
# Test that the proxy environment variables are set correctly
18751877
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1878+
# Delete in case our environment has this set
1879+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18761880

18771881
client = DefaultAsyncHttpxClient()
18781882

0 commit comments

Comments
 (0)