(caplog: pytest.LogCaptureFixture)
| 144 | |
| 145 | |
| 146 | def 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 | |
| 158 | def test_run_match_config_params() -> None: |