Skip to content

Commit 2e233ea

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 5e72d8e commit 2e233ea

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

908910
client = DefaultHttpxClient()
909911

@@ -1756,6 +1758,8 @@ async def test_get_platform(self) -> None:
17561758
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
17571759
# Test that the proxy environment variables are set correctly
17581760
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1761+
# Delete in case our environment has this set
1762+
monkeypatch.delenv("HTTP_PROXY", raising=False)
17591763

17601764
client = DefaultAsyncHttpxClient()
17611765

0 commit comments

Comments
 (0)