Skip to content

Commit de1744e

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 454c8de commit de1744e

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

947949
client = DefaultHttpxClient()
948950

@@ -1843,6 +1845,8 @@ async def test_get_platform(self) -> None:
18431845
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18441846
# Test that the proxy environment variables are set correctly
18451847
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1848+
# Delete in case our environment has this set
1849+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18461850

18471851
client = DefaultAsyncHttpxClient()
18481852

0 commit comments

Comments
 (0)