-
I dont know if this is an insane question or not. But suppose I want to purposefully cause a ConnectionResetError or other sorts of connection exceptions on the client (for testing their error/retry handling). Is it possible to induce starlette (through fastapi if relevant) to behave in that way for specific requests? |
Beta Was this translation helpful? Give feedback.
Answered by
adriangb
Aug 25, 2023
Replies: 1 comment 3 replies
-
Yes, but you'll have to do some pure ASGI stuff. We do it in some of our tests: starlette/tests/middleware/test_base.py Lines 746 to 783 in a8b8856 |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, but you'll have to do some pure ASGI stuff. We do it in some of our tests:
starlette/tests/middleware/test_base.py
Lines 746 to 783 in a8b8856