Skip to content

Commit 17a5609

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 8215016 commit 17a5609

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

931933
client = DefaultHttpxClient()
932934

@@ -1819,6 +1821,8 @@ async def test_get_platform(self) -> None:
18191821
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18201822
# Test that the proxy environment variables are set correctly
18211823
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1824+
# Delete in case our environment has this set
1825+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18221826

18231827
client = DefaultAsyncHttpxClient()
18241828

0 commit comments

Comments
 (0)