You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this will always be a limitation of the TestClient. I think we should add a test case, and maybe add a few lines on the documentation on how to test this.
Checklist
master
.Describe the bug
When using the TestClient provided by the starlette framework,
http.disconnect
are not received. This is a problem if trying to test streaming.To reproduce
Implement simple app:
Write test using provided TestClient, which closes the connection during "processing":
Expected behavior
The server behaviour should be the same if using TestClient or Uvicorn. If I run the application provided above with Uvicorn:
And write a test using the normal
requests
as follows:The
http.disconnect
event is received. This should be the same for theTestClient
Actual behavior
No
http.disconnect
event is received by the app when usingTestClient
.Debugging material
Environment
Additional context
The text was updated successfully, but these errors were encountered: