-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
ASGITransport does not stream responses. #2186
Comments
You've identified this correctly in your comment here... #1787 (comment) The issue is that the ASGITransport doesn't stream responses. |
@tomchristie Is there any update on this one ? Or has it already been fixed ? |
As mentioned in havardthom's comment, I had a previous PR from a long time ago here which attempted to solve something that would resolve this: #998 It's okay to start off that PR, adjusting anything that needs to be due to changes in HTTPX since then. |
If no one takes this until the end of the year, I will. EDIT on 28 July 2023: I lied. |
I've run into the same issue, and unfortunately @florimondmanca's branch didn't work for me (all requests hang, not just SSE streams). I used that as inspiration though, and am monkey patching the transport in my tests. Here's a gist: https://gist.github.com/richardhundt/17dfccb5c1e253f798999fc2b2417d7e |
My suggestion would be that we document this as a known constraint. If someone is invested in resolving it, then implementing it as a third party transport would be a good first step. |
I've got the same problem - FastAPI SSE endpoint I'd like to test. |
Current behaviour:
uvicorn test_endless_sse:app --reload
thenpython test_endless_sse.py
works.pytest test_endless_sse.py
hangs forever.Expected behaviour:
pytest test_endless_sse.py
should passRelated: fastapi/fastapi#2006
The text was updated successfully, but these errors were encountered: