Skip to content

Commit 09cfd99

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 17b88d9 commit 09cfd99

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

11751177
client = DefaultHttpxClient()
11761178

@@ -2302,6 +2304,8 @@ async def test_get_platform(self) -> None:
23022304
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
23032305
# Test that the proxy environment variables are set correctly
23042306
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
2307+
# Delete in case our environment has this set
2308+
monkeypatch.delenv("HTTP_PROXY", raising=False)
23052309

23062310
client = DefaultAsyncHttpxClient()
23072311

0 commit comments

Comments
 (0)