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

Function test_run_startup_failure

tests/test_main.py:146–155  ·  view source on GitHub ↗
(caplog: pytest.LogCaptureFixture)

Source from the content-addressed store, hash-verified

144
145
146def test_run_startup_failure(caplog: pytest.LogCaptureFixture) -> None:
147 async def app(scope, receive, send):
148 assert scope["type"] == "lifespan"
149 message = await receive()
150 if message["type"] == "lifespan.startup":
151 raise RuntimeError("Startup failed")
152
153 with pytest.raises(SystemExit) as exit_exception:
154 run(app, lifespan="on")
155 assert exit_exception.value.code == 3
156
157
158def test_run_match_config_params() -> None:

Callers

nothing calls this directly

Calls 1

runFunction · 0.90

Tested by

no test coverage detected