Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use httpx for wptserve tests instead of hyper
hyper is no longer maintained, and doesn't work with Python 3.10. The vendored hyper is removed entirely, and replaced by httpx installed using pip. Tests are updated, mostly in trivial ways. A few cases are interesting: - When httpx is used to POST, `handle_data` ends up called two times instead of once, first with the data, and then with an empty byte string. Whether this is an httpx bug or not, test_h2_data.py and test_h2_headers_data.py are adapted to deal with this, and changed to case-swap the input instead so that no buffering is needed. - `test_encode` previously failed an assert in the handler, but the response wasn't checked at all, so this wasn't noticed. - `test_push` is dropped since it can't be tested using httpx. - `test_raw_header_frame_invalid` is dropped since it ends up testing the error handling of the client, and httpx doesn't treat this input as an error. A better test would just check what bytes were sent over the wire, but don't bother, it's more work than seems justified. - `test_http_version` is added to make sure these tests keep using HTTP/2 even if httpx behavior changes in the future. Fixes #28784. Fixes #31315.
- Loading branch information