Skip to content

Commit d0ec2d9

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent f241bf6 commit d0ec2d9

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

971973
client = DefaultHttpxClient()
972974

@@ -1887,6 +1889,8 @@ async def test_get_platform(self) -> None:
18871889
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18881890
# Test that the proxy environment variables are set correctly
18891891
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1892+
# Delete in case our environment has this set
1893+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18901894

18911895
client = DefaultAsyncHttpxClient()
18921896

0 commit comments

Comments
 (0)