Add timeout argument to WebSocketTestSession.receive #2595
-
In my test, I'd like to fail if no message is received after a certain duration, but I can't do that easily, because currently, My suggestion is to add a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You can use anyio: with anyio.fail_after(123):
await ws.receive() |
Beta Was this translation helpful? Give feedback.
-
There's a previous issue about this. I suggest reading that. |
Beta Was this translation helpful? Give feedback.
There's a previous issue about this. I suggest reading that.