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

Function test_invalid_module

tests/importer/test_importer.py:13–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def test_invalid_module() -> None:
14 with pytest.raises(ImportFromStringError) as exc_info:
15 import_from_string("module_does_not_exist:myattr")
16 expected = 'Could not import module "module_does_not_exist".'
17 assert expected in str(exc_info.value)
18
19
20def test_invalid_attr() -> None:

Callers

nothing calls this directly

Calls 1

import_from_stringFunction · 0.90

Tested by

no test coverage detected