Skip to content

Match repeated query parameter values in order - #187

Open
bensynapse wants to merge 1 commit into
h2non:masterfrom
bensynapse:fix-repeated-query-values
Open

bensynapse wants to merge 1 commit into
h2non:masterfrom
bensynapse:fix-repeated-query-values

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

pook.get("http://example.com/?x=a&x=b") rejects a GET for that identical URL. The query matcher compares every expected value with every received value.

This compares list values pairwise and checks their count. Repeated values must occur in the expected order. Scalar matching and unrelated query keys keep their existing behavior. The params documentation now explains this distinction.

The regression tests cover both URL and params registration across six client paths, including sync and async HTTPX. Eighteen new cases fail with the original matcher.

hatch run ci passes. The full suite passes 264 tests on Python 3.10 through 3.14, with three expected failures per version. PyPy 3.11 passes 263 tests with the same expected failures. Strict documentation builds, hatch build -c and twine check --strict pass.

Validation used aiohttp 3.13.3 and urllib3 2.5.0, both within the declared dependency ranges. Without those local pins, newer dependency APIs produce 31 existing failures on unchanged upstream. The two new aiohttp client cases hit the same existing exception.

jharibo added a commit to jharibo/pookx that referenced this pull request Oct 21, 2026
Every expected value was compared against every received value, so
?x=a&x=b never matched. List values now match pairwise and by count.
Taken from h2non#187.

Co-authored-by: bensynapse <118375461+bensynapse@users.noreply.github.com>
@jharibo

jharibo commented Oct 21, 2026

Copy link
Copy Markdown

Thanks for this. I've adopted it in pookx, a maintained fork, released in 2.2.2 with you credited as co-author on the commit. See #186 for the background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants