Skip to content

Commit 5b3d12b

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent d73aa48 commit 5b3d12b

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

961963
client = DefaultHttpxClient()
962964

@@ -1869,6 +1871,8 @@ async def test_get_platform(self) -> None:
18691871
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18701872
# Test that the proxy environment variables are set correctly
18711873
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1874+
# Delete in case our environment has this set
1875+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18721876

18731877
client = DefaultAsyncHttpxClient()
18741878

0 commit comments

Comments
 (0)