Description
The unit suite is not portable to a supported Windows checkout. On Windows with normal Git CRLF conversion and common proxy environment variables, four otherwise-local tests fail.
Reproduction
On Windows/Python 3.12 after installing the dev dependencies:
python -m pytest -q -n 0 -k "not aiohttp"
Observed failures:
tests/test_transform.py:424 (sync and async): tests/sample_file.txt is checked out with CRLF, producing SGVsbG8sIHdvcmxkIQ0K; the assertion hard-codes LF bytes (SGVsbG8sIHdvcmxkIQo=).
tests/test_client.py:996 and tests/test_client.py:1936: the proxy tests expect one mount after setting HTTP_PROXY, but inherited NO_PROXY/proxy environment state can cause httpx to produce zero matching mounts.
Result from this audit: 4 failed, 1072 passed, 2 skipped after excluding the separately parameterized aiohttp cases. The remaining suite passes.
Expected behavior
Tests should pass on every OS advertised in pyproject.toml (Operating System :: Microsoft :: Windows) and should isolate themselves from host proxy variables and line-ending conversion.
Suggested fixes:
- Make
sample_file.txt binary-stable via .gitattributes, or derive the expected base64 from the file bytes rather than a hard-coded newline convention.
- Clear all relevant proxy/no-proxy environment variables in the proxy tests before setting the values under test.
- Add a Windows CI job, at least for the core unit suite.
Why it matters
Windows contributors currently cannot get a clean test run from an unmodified checkout, and the Linux-only CI matrix cannot catch these regressions.
Description
The unit suite is not portable to a supported Windows checkout. On Windows with normal Git CRLF conversion and common proxy environment variables, four otherwise-local tests fail.
Reproduction
On Windows/Python 3.12 after installing the dev dependencies:
Observed failures:
tests/test_transform.py:424(sync and async):tests/sample_file.txtis checked out with CRLF, producingSGVsbG8sIHdvcmxkIQ0K; the assertion hard-codes LF bytes (SGVsbG8sIHdvcmxkIQo=).tests/test_client.py:996andtests/test_client.py:1936: the proxy tests expect one mount after settingHTTP_PROXY, but inheritedNO_PROXY/proxy environment state can cause httpx to produce zero matching mounts.Result from this audit:
4 failed, 1072 passed, 2 skippedafter excluding the separately parameterized aiohttp cases. The remaining suite passes.Expected behavior
Tests should pass on every OS advertised in
pyproject.toml(Operating System :: Microsoft :: Windows) and should isolate themselves from host proxy variables and line-ending conversion.Suggested fixes:
sample_file.txtbinary-stable via.gitattributes, or derive the expected base64 from the file bytes rather than a hard-coded newline convention.Why it matters
Windows contributors currently cannot get a clean test run from an unmodified checkout, and the Linux-only CI matrix cannot catch these regressions.