MCPcopy
hub / github.com/encode/uvicorn / test_app_unimportable_other

Function test_app_unimportable_other

tests/test_config.py:214–224  ·  view source on GitHub ↗
(caplog: pytest.LogCaptureFixture)

Source from the content-addressed store, hash-verified

212
213
214def test_app_unimportable_other(caplog: pytest.LogCaptureFixture) -> None:
215 config = Config(app="tests.test_config:app")
216 with pytest.raises(SystemExit):
217 config.load()
218 error_messages = [
219 record.message for record in caplog.records if record.name == "uvicorn.error" and record.levelname == "ERROR"
220 ]
221 assert (
222 'Error loading ASGI app. Attribute "app" not found in module "tests.test_config".' # noqa: E501
223 == error_messages.pop(0)
224 )
225
226
227def test_app_factory(caplog: pytest.LogCaptureFixture) -> None:

Callers

nothing calls this directly

Calls 2

loadMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected