MCPcopy Create free account
hub / github.com/encode/starlette / test_wsgi_exception

Function test_wsgi_exception

tests/middleware/test_wsgi.py:83–89  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

81
82
83def test_wsgi_exception(test_client_factory: TestClientFactory) -> None:
84 # Note that we're testing the WSGI app directly here.
85 # The HTTP protocol implementations would catch this error and return 500.
86 app = WSGIMiddleware(raise_exception)
87 client = test_client_factory(app)
88 with pytest.raises(RuntimeError):
89 client.get("/")
90
91
92def test_wsgi_exc_info(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 3

WSGIMiddlewareClass · 0.90
test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected