MCPcopy
hub / github.com/encode/uvicorn / test

Function test

tests/test_lifespan.py:25–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 await send({"type": "lifespan.shutdown.complete"})
24
25 async def test():
26 config = Config(app=app, lifespan="on")
27 lifespan = LifespanOn(config)
28
29 assert not startup_complete
30 assert not shutdown_complete
31 await lifespan.startup()
32 assert startup_complete
33 assert not shutdown_complete
34 await lifespan.shutdown()
35 assert startup_complete
36 assert shutdown_complete
37
38 loop = asyncio.new_event_loop()
39 loop.run_until_complete(test())

Callers 10

test_lifespan_onFunction · 0.85
test_lifespan_offFunction · 0.85
test_lifespan_autoFunction · 0.85
test_lifespan_stateFunction · 0.85

Calls 7

startupMethod · 0.95
shutdownMethod · 0.95
startupMethod · 0.95
shutdownMethod · 0.95
ConfigClass · 0.90
LifespanOnClass · 0.90
LifespanOffClass · 0.90

Tested by

no test coverage detected