This release replaces the underlying HTTP client used on the TestClient
(requests
➡️ httpx
), and as those clients differ a bit on their API, your test suite will likely break. To make the migration smoother, you can use the bump-testclient
tool.
Changed
- Replace
requests
withhttpx
inTestClient
#1376.
Added
- Add
WebSocketException
and support for WebSocket exception handlers #1263. - Add
middleware
parameter toMount
class #1649. - Officially support Python 3.11 1863.
- Implement
__repr__
for route classes #1864.
Fixed
- Fix bug on which
BackgroundTasks
were cancelled when usingBaseHTTPMiddleware
and client disconnected #1715.