Cannot exit the scope in Websocket Testing with TestClient #1797
Replies: 2 comments
-
I can help if a standalone minimal reproducible example is created for it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally posted here, thx to @Kludex for forwarding me to correct destination.
Example Code
I know this might be a little bit a hard reproduction, but I encountered this problem in this complex use-case, so it's worth it IMO.
Description
The problem is, the test does not end because it cannot exit this scope:
with client.websocket_connect("/queue/join") as websocket:
Btw I was able to finish the test while debugging it line by line, so it might've worked because of debugger interrupts.
And this is what I get when I ctrl+c out of the non-ending test.
Operating System
macOS
Operating System Details
No response
FastAPI Version
0.79.0
Python Version
3.8.2
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions