MCPcopy
hub / github.com/encode/starlette / test_app_debug

Function test_app_debug

tests/test_applications.py:338–353  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

336
337
338def 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
356def test_app_add_route(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 4

StarletteClass · 0.90
RouteClass · 0.90
test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected