Skip to content

Commit 709aff4

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent fdc5e91 commit 709aff4

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

955957
client = DefaultHttpxClient()
956958

@@ -1859,6 +1861,8 @@ async def test_get_platform(self) -> None:
18591861
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18601862
# Test that the proxy environment variables are set correctly
18611863
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1864+
# Delete in case our environment has this set
1865+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18621866

18631867
client = DefaultAsyncHttpxClient()
18641868

0 commit comments

Comments
 (0)