(http_protocol_cls: type[HTTPProtocol])
| 535 | |
| 536 | |
| 537 | async def test_app_exception(http_protocol_cls: type[HTTPProtocol]): |
| 538 | async def app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable): |
| 539 | raise Exception() |
| 540 | |
| 541 | protocol = get_connected_protocol(app, http_protocol_cls) |
| 542 | protocol.data_received(SIMPLE_GET_REQUEST) |
| 543 | await protocol.loop.run_one() |
| 544 | assert b"HTTP/1.1 500 Internal Server Error" in protocol.transport.buffer |
| 545 | assert protocol.transport.is_closing() |
| 546 | |
| 547 | |
| 548 | async def test_exception_during_response(http_protocol_cls: type[HTTPProtocol]): |
nothing calls this directly
no test coverage detected