Skip to content

Commit 548c10c

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 77a8a4f commit 548c10c

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

926928
client = DefaultHttpxClient()
927929

@@ -1809,6 +1811,8 @@ async def test_get_platform(self) -> None:
18091811
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18101812
# Test that the proxy environment variables are set correctly
18111813
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1814+
# Delete in case our environment has this set
1815+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18121816

18131817
client = DefaultAsyncHttpxClient()
18141818

0 commit comments

Comments
 (0)