Skip to content

Commit 6bc2bb4

Browse files
chore(internal): make test_proxy_environment_variables more resilient
1 parent 2ecc682 commit 6bc2bb4

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

968970
client = DefaultHttpxClient()
969971

@@ -1876,6 +1878,8 @@ async def test_get_platform(self) -> None:
18761878
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
18771879
# Test that the proxy environment variables are set correctly
18781880
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1881+
# Delete in case our environment has this set
1882+
monkeypatch.delenv("HTTP_PROXY", raising=False)
18791883

18801884
client = DefaultAsyncHttpxClient()
18811885

0 commit comments

Comments
 (0)