Skip to content

Commit b5ee95d

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 17c6632 commit b5ee95d

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

985987
client = DefaultHttpxClient()
986988

@@ -1907,6 +1909,8 @@ async def test_get_platform(self) -> None:
19071909
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
19081910
# Test that the proxy environment variables are set correctly
19091911
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1912+
# Delete in case our environment has this set
1913+
monkeypatch.delenv("HTTP_PROXY", raising=False)
19101914

19111915
client = DefaultAsyncHttpxClient()
19121916

0 commit comments

Comments
 (0)