Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The base64 tests assert on this fixture's exact bytes, so it must not be
# rewritten to CRLF on checkout (the default on Windows with core.autocrlf).
tests/sample_file.txt -text
12 changes: 8 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,15 +1324,17 @@ def retry_handler(_request: httpx2.Request) -> httpx2.Response:

def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
# Delete in case our environment has any proxy env vars set
# Delete in case our environment has any proxy env vars set. This must
# happen before setting HTTPS_PROXY: os.environ is case-insensitive on
# Windows, so deleting "https_proxy" afterwards would remove it again.
monkeypatch.delenv("HTTP_PROXY", raising=False)
monkeypatch.delenv("ALL_PROXY", raising=False)
monkeypatch.delenv("NO_PROXY", raising=False)
monkeypatch.delenv("http_proxy", raising=False)
monkeypatch.delenv("https_proxy", raising=False)
monkeypatch.delenv("all_proxy", raising=False)
monkeypatch.delenv("no_proxy", raising=False)
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")

client = DefaultHttpxClient()

Expand Down Expand Up @@ -2625,15 +2627,17 @@ async def test_get_platform(self) -> None:

async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
# Delete in case our environment has any proxy env vars set
# Delete in case our environment has any proxy env vars set. This must
# happen before setting HTTPS_PROXY: os.environ is case-insensitive on
# Windows, so deleting "https_proxy" afterwards would remove it again.
monkeypatch.delenv("HTTP_PROXY", raising=False)
monkeypatch.delenv("ALL_PROXY", raising=False)
monkeypatch.delenv("NO_PROXY", raising=False)
monkeypatch.delenv("http_proxy", raising=False)
monkeypatch.delenv("https_proxy", raising=False)
monkeypatch.delenv("all_proxy", raising=False)
monkeypatch.delenv("no_proxy", raising=False)
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")

client = DefaultAsyncHttpxClient()

Expand Down