-
Notifications
You must be signed in to change notification settings - Fork 37
fix: fix match_params for bool #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Hello, thanks for the proposal, if you can make the existing test suite pass I can review it. But for now some tests are failing, meaning this proposal introduce a regression. |
tests/test_httpx_async.py
Outdated
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_url_query_params_bool_matching(httpx_mock: HTTPXMock) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also test with a list of values? in a single param ? With bool, int and str values inside the list in the httpx query, and bool and str on httpx_mock matcher
pytest_httpx/_request_matcher.py
Outdated
| params = { | ||
| k: ( | ||
| primitive_value_to_str(v) | ||
| if isinstance(v, (str, int, float, bool)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I missed something, int and float are not tested
|
@Colin-b Hi! |
tests/test_httpx_internals.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit testing an internal function does not ensure this code is actually reachable for clients. Could you write tests with those values the same way you wrote your other tests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done)
|
|
@Colin-b should I add # pragma: no cover ? |



#197
@Colin-b