Colin-b / pytest_httpx

pytest fixture to mock HTTPX
https://colin-b.github.io/pytest_httpx/
MIT License
363 stars 31 forks source link

feat: add support for `match_params` allowing partial params matching #173

Open pbabics opened 4 days ago

pbabics commented 4 days ago

Hi,

In my company we've have a case where we want to match one parameter of query string and ignore others, right now this is only possible via regex as using httpx.URL(..., params = ...) will convert all the params to strings, so if we pass something like {"a": 1, "b": ANY} we get{"a": 1, "b": "<ANY>"}, that does not get matched.

So this PR is adding support for extra keyword argument match_params allowing to pass them directly

sonarcloud[bot] commented 4 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud