Skip to content

Commit f4e7369

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 991ecbd commit f4e7369

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

10421044
client = DefaultHttpxClient()
10431045

@@ -2026,6 +2028,8 @@ async def test_get_platform(self) -> None:
20262028
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
20272029
# Test that the proxy environment variables are set correctly
20282030
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
2031+
# Delete in case our environment has this set
2032+
monkeypatch.delenv("HTTP_PROXY", raising=False)
20292033

20302034
client = DefaultAsyncHttpxClient()
20312035

0 commit comments

Comments
 (0)