Skip to content

Commit 821dd3f

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent f7c4465 commit 821dd3f

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

10391041
client = DefaultHttpxClient()
10401042

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

20282032
client = DefaultAsyncHttpxClient()
20292033

0 commit comments

Comments
 (0)