Skip to content

Commit f75a80e

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent ca09e91 commit f75a80e

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

993995
client = DefaultHttpxClient()
994996

@@ -1931,6 +1933,8 @@ async def test_get_platform(self) -> None:
19311933
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19321934
# Test that the proxy environment variables are set correctly
19331935
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1936+
# Delete in case our environment has this set
1937+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19341938

19351939
client = DefaultAsyncHttpxClient()
19361940

0 commit comments

Comments
 (0)