(test_client_factory: TestClientFactory)
| 336 | |
| 337 | |
| 338 | def test_app_debug(test_client_factory: TestClientFactory) -> None: |
| 339 | async def homepage(request: Request) -> None: |
| 340 | raise RuntimeError() |
| 341 | |
| 342 | app = Starlette( |
| 343 | routes=[ |
| 344 | Route("/", homepage), |
| 345 | ], |
| 346 | ) |
| 347 | app.debug = True |
| 348 | |
| 349 | client = test_client_factory(app, raise_server_exceptions=False) |
| 350 | response = client.get("/") |
| 351 | assert response.status_code == 500 |
| 352 | assert "RuntimeError" in response.text |
| 353 | assert app.debug |
| 354 | |
| 355 | |
| 356 | def test_app_add_route(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected