Skip to content

Commit e12df38

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 5c6bcd7 commit e12df38

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

986988
client = DefaultHttpxClient()
987989

@@ -1923,6 +1925,8 @@ async def test_get_platform(self) -> None:
19231925
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19241926
# Test that the proxy environment variables are set correctly
19251927
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1928+
# Delete in case our environment has this set
1929+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19261930

19271931
client = DefaultAsyncHttpxClient()
19281932

0 commit comments

Comments
 (0)