Skip to content

Commit 813e69d

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent db43c2d commit 813e69d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_client.py

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

963965
client = DefaultHttpxClient()
964966

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

18751879
client = DefaultAsyncHttpxClient()
18761880

0 commit comments

Comments
 (0)