Skip to content

Commit 3608c6e

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 7488011 commit 3608c6e

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

951953
client = DefaultHttpxClient()
952954

@@ -1853,6 +1855,8 @@ async def test_get_platform(self) -> None:
18531855
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18541856
# Test that the proxy environment variables are set correctly
18551857
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1858+
# Delete in case our environment has this set
1859+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18561860

18571861
client = DefaultAsyncHttpxClient()
18581862

0 commit comments

Comments
 (0)