Skip to content

Commit 6f2864d

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent c17f87b commit 6f2864d

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

966968
client = DefaultHttpxClient()
967969

@@ -1883,6 +1885,8 @@ async def test_get_platform(self) -> None:
18831885
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18841886
# Test that the proxy environment variables are set correctly
18851887
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1888+
# Delete in case our environment has this set
1889+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18861890

18871891
client = DefaultAsyncHttpxClient()
18881892

0 commit comments

Comments
 (0)