Repository navigation
Preserve blank parameters in fragment identifier matching - #838
Merged
Merged
Conversation
markstory
approved these changes
Oct 6, 2026
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 type of PR is this?
Description
fragment_identifier_matcher('flag=&value=1')currently accepts#value=1, andfragment_identifier_matcher('flag=')accepts#other=or no fragment.parse_qsldrops blank values by default, so these distinct fragments become equal after parsing.Retain blank values when parsing both expected and actual query-string-style fragments. Parameter order remains insignificant, while blank parameter names and multiplicity are checked. Opaque fragment matching is unchanged.
Add eight direct matcher cases and a requests integration test covering missing, different, reordered, and duplicate parameters. Five regression cases fail before the fix; all pass afterward.
Related Issues
No existing issue identified for this specific case.
PR checklist
toxandpre-commitchecks locallyCHANGESValidation on macOS / Python 3.13.14:
python -m pytest . --asyncio-mode=auto --cov responses --cov-report term-missing -q: 261 passed, 99% overall coverage.matchers.pyand one intest_recorder.py), also reproduced on an unchanged archive of the upstream commit. This change adds none.git diff --checkpassed.The complete multi-version tox matrix was not run locally.
Added/updated tests?
This contribution was prepared with assistance from OpenAI Codex.