Skip to content

Commit 481029b

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 2c7a465 commit 481029b

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

955957
client = DefaultHttpxClient()
956958

@@ -1861,6 +1863,8 @@ async def test_get_platform(self) -> None:
18611863
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18621864
# Test that the proxy environment variables are set correctly
18631865
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1866+
# Delete in case our environment has this set
1867+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18641868

18651869
client = DefaultAsyncHttpxClient()
18661870

0 commit comments

Comments
 (0)