Repository navigation
Ensure JSON representation is compact. #3363 - #3367
Conversation
| import pytest | ||
|
|
||
| import httpx | ||
| from httpx._content import encode_json |
There was a problem hiding this comment.
I've just noticed this accidentally snuck in a private import.
@BERRADA-Omar would you be up for refactoring these tests?
We can test this against public API using httpx.Request(). Eg...
data = {...}
req = httpx.Request("POST", "https://www.example.com/", json=data)
assert req.content == ...
assert req.headers = ...There was a problem hiding this comment.
Hello, i'll make the change.
There was a problem hiding this comment.
@tomchristie i see that this is already fixed ?
|
This broke the test suite on Starlette. ref.: Kludex/starlette#2773 |
|
Thanks for the feedback. |
|
@tomchristie This PR not only adjusts the ASCII representation but also alters the default JSON separators. These changes lead to unnecessary modifications of JSON objects, resulting in altered validation hashes that broke some of our tests. |
* Update pyproject.toml * Update test_server.py: hash is changed because of HTTPX changes: encode/httpx#3367
|
Thoughts...
|
|
@tomchristie More detailed CHANGELOG is a "must". While it won鈥檛 solve the technical issue, it will simplify the debugging. When moving forward a codebase, tough changes might be necessary, that is obvious. However, providing a grace period for users can ease the process. E.g., you could introduce a warning in the codebase and maintain it for two minor versions before enforcing the update. |
Co-authored-by: Tom Christie <tom@tomchristie.com>
Summary
this PR solves the issues mentionned here #3363
Checklist