(test_client_factory: TestClientFactory)
| 715 | |
| 716 | |
| 717 | def test_raise_on_shutdown(test_client_factory: TestClientFactory) -> None: |
| 718 | @contextlib.asynccontextmanager |
| 719 | async def lifespan(app: Starlette) -> AsyncIterator[None]: |
| 720 | yield |
| 721 | raise RuntimeError("Shutdown failed") |
| 722 | |
| 723 | app = Router(lifespan=lifespan) |
| 724 | |
| 725 | with pytest.raises(RuntimeError, match="Shutdown failed"): |
| 726 | with test_client_factory(app): |
| 727 | pass # pragma: no cover |
| 728 | |
| 729 | |
| 730 | def test_partial_async_endpoint(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected