Skip to content

Commit e567054

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 9110978 commit e567054

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

997999
client = DefaultHttpxClient()
9981000

@@ -1947,6 +1949,8 @@ async def test_get_platform(self) -> None:
19471949
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19481950
# Test that the proxy environment variables are set correctly
19491951
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1952+
# Delete in case our environment has this set
1953+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19501954

19511955
client = DefaultAsyncHttpxClient()
19521956

0 commit comments

Comments
 (0)