Repository navigation
[CB-0] [sdk-superfan] Make the base64 and proxy tests pass on Windows checkouts - #224
Draft
spicysouvlaki wants to merge 1 commit into
Draft
spicysouvlaki wants to merge 1 commit into
spicysouvlaki wants to merge 1 commit into
Conversation
Two Windows-only failures: 1. test_base64_file_input hard-codes the base64 of "Hello, world!\n". With core.autocrlf=true (the Git for Windows default) tests/sample_file.txt is checked out with CRLF and the encoding becomes ...IQ0K. Reproduced on macOS with `git -c core.autocrlf=true checkout -- tests/sample_file.txt`: bytes end 0d0a, both cases fail. `.gitattributes` now marks the fixture `-text`, so it keeps LF everywhere; same checkout ends 0a, both pass. 2. test_proxy_environment_variables sets HTTPS_PROXY and then deletes `https_proxy`. Windows env vars are case-insensitive (CPython's nt os.environ upper-cases keys), so that delete removes the variable the test just set, httpx sees no env proxy, and `len(mounts) == 1` fails. Reproduced on macOS by loading a pytest plugin that upper-cases os.environ keys the way nt does: 2 failed before, 2 passed after setting HTTPS_PROXY last. Not reproduced: the report's claim that an inherited NO_PROXY breaks the proxy test. The test already deletes NO_PROXY/no_proxy; only a mixed-case `No_Proxy` on POSIX survives that, which is not a real-world setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened
#181. On Windows, 4 tests fail:
test_base64_file_inputproducesSGVsbG8sIHdvcmxkIQ0Kwhere the test expectsSGVsbG8sIHdvcmxkIQo=, andtest_proxy_environment_variablesfailsassert len(mounts) == 1. Each runs sync and async.Why
tests/sample_file.txtwith CRLF, buttest_transform.py:425hard-codes the LF encoding.test_client.py:1013-1021setsHTTPS_PROXYand then deleteshttps_proxy. Windows env vars are case-insensitive, so the delete removes the value the test just set.Fix
.gitattributesentry,tests/sample_file.txt -text.HTTPS_PROXYafter the deletes.Tests
git -c core.autocrlf=true checkout -- tests/sample_file.txt. Before the fix the file ends in0d0aand 2 tests fail. After, it ends in0aand 2 pass.os.environkeys the way CPython does on Windows. Before the fix: 2 failed. After: 2 passed../scripts/lint: clean../scripts/test(py3.9 pydantic v2/v1, py3.14): all pass.Risk and rollout
tests/test_client.pyis generated, and this is a sealed 2-line edit. The same code exists upstream, so a regen may conflict there..gitattributesis a new custom file. Nothing ships to users.Refs #181
🤖 Generated with Claude Code