Files
nginx-unit/test/python/lifespan/failed/asgi.py
Andrei Zeliankou 5a8337933d Tests: pathlib used where appropriate
Also fixed various pylint errors and style issues.
2024-01-15 15:48:58 +00:00

12 lines
453 B
Python

async def application(scope, receive, send):
if scope['type'] == 'lifespan':
while True:
message = await receive()
if message['type'] == 'lifespan.startup':
await send({"type": "lifespan.startup.failed"})
raise Exception('Exception blah')
if message['type'] == 'lifespan.shutdown':
await send({'type': 'lifespan.shutdown.complete'})
return