(
test_client_factory: TestClientFactory,
)
| 919 | |
| 920 | |
| 921 | def test_exception_on_mounted_apps( |
| 922 | test_client_factory: TestClientFactory, |
| 923 | ) -> None: |
| 924 | def exc(request: Request) -> None: |
| 925 | raise Exception("Exc") |
| 926 | |
| 927 | sub_app = Starlette(routes=[Route("/", exc)]) |
| 928 | app = Starlette(routes=[Mount("/sub", app=sub_app)]) |
| 929 | |
| 930 | client = test_client_factory(app) |
| 931 | with pytest.raises(Exception) as ctx: |
| 932 | client.get("/sub/") |
| 933 | assert str(ctx.value) == "Exc" |
| 934 | |
| 935 | |
| 936 | def test_mounted_middleware_does_not_catch_exception( |
nothing calls this directly
no test coverage detected