Repository navigation
Conversation
|
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.



Multipart uploads with an explicit boundary such as
test-boundarycurrently failmatch_filesbecause the matcher only extracts lowercase hexadecimal boundaries. This also makesget_requests(match_files=...)return no matching requests.The matcher now reuses a nonempty ASCII boundary from the first body line and retains the full-body equality check. Non-ASCII prefixes remain nonmatches, so arbitrary binary uploads can reach later response matchers without an ASCII-decoding error. Includes sync/async selection and retrieval regressions and an Unreleased changelog entry.
Reproduction (HTTPX 0.28.1):
Before:
httpx.TimeoutExceptionand an unused response at teardown. After: HTTP 201. For retrieval, register an unrestricted response, send the same request, then comparehttpx_mock.get_requests(match_files=files)with[response.request]: before[], after the captured request.Validation on macOS arm64: the full suite passed on Python 3.11.16 and 3.13.12 (390 tests each; 100% statement/branch coverage), 170 additional probes passed, and all eight pre-commit hooks passed. Python 3.12/3.14/3.15, Linux/Windows, and package builds were not run locally; upstream CI is separate. This retains the existing body-based comparison and does not add strict multipart syntax or header/body consistency validation.
Overlap: #239 is currently open and does not include this fix. If that migration lands first, these two new test modules need adaptation to its backend fixture and fresh HTTPX-only, HTTPX2-only, and combined validation; their direct
import httpxcurrently fails collection with only HTTPX2 installed.AI assistance was used to prepare implementation and regression tests.