Skip to content

Commit 09dfc73

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent fa41519 commit 09dfc73

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

958960
client = DefaultHttpxClient()
959961

@@ -1865,6 +1867,8 @@ async def test_get_platform(self) -> None:
18651867
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18661868
# Test that the proxy environment variables are set correctly
18671869
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1870+
# Delete in case our environment has this set
1871+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18681872

18691873
client = DefaultAsyncHttpxClient()
18701874

0 commit comments

Comments
 (0)