Tests: added ASGI Lifespan.
This commit is contained in:
11
test/python/lifespan/failed/asgi.py
Normal file
11
test/python/lifespan/failed/asgi.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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')
|
||||
|
||||
elif message['type'] == 'lifespan.shutdown':
|
||||
await send({'type': 'lifespan.shutdown.complete'})
|
||||
return
|
||||
Reference in New Issue
Block a user