MCPcopy Index your code
hub / github.com/sphinx-doc/sphinx / test_ModuleAnalyzer_get_module_source

Function test_ModuleAnalyzer_get_module_source

tests/test_pycode/test_pycode.py:18–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def test_ModuleAnalyzer_get_module_source() -> None:
19 assert isinstance(sphinx.__spec__.loader, SourceFileLoader) # type checking
20 assert ModuleAnalyzer.get_module_source('sphinx') == (
21 Path(sphinx.__file__),
22 sphinx.__spec__.loader.get_source('sphinx'),
23 )
24
25 # failed to obtain source information from builtin modules
26 with pytest.raises(PycodeError):
27 ModuleAnalyzer.get_module_source('builtins')
28 with pytest.raises(PycodeError):
29 ModuleAnalyzer.get_module_source('itertools')
30
31
32def test_ModuleAnalyzer_for_string() -> None:

Callers

nothing calls this directly

Calls 2

get_module_sourceMethod · 0.80
get_sourceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…