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

Function test_ModuleAnalyzer_for_module

tests/test_pycode/test_pycode.py:44–56  ·  view source on GitHub ↗
(rootdir: Path)

Source from the content-addressed store, hash-verified

42
43
44def test_ModuleAnalyzer_for_module(rootdir: Path) -> None:
45 analyzer = ModuleAnalyzer.for_module('sphinx')
46 assert analyzer.modname == 'sphinx'
47 assert analyzer.srcname == str(SPHINX_MODULE_PATH)
48
49 saved_path = sys.path.copy()
50 sys.path.insert(0, str(rootdir / 'test-pycode'))
51 try:
52 analyzer = ModuleAnalyzer.for_module('cp_1251_coded')
53 docs = analyzer.find_attr_docs()
54 assert docs == {('', 'X'): ['It MUST look like X="\u0425"', '']}
55 finally:
56 sys.path[:] = saved_path
57
58
59def test_ModuleAnalyzer_find_tags() -> None:

Callers

nothing calls this directly

Calls 3

for_moduleMethod · 0.80
find_attr_docsMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…