MCPcopy
hub / github.com/sphinx-doc/sphinx / test_nested_function

Function test_nested_function

tests/test_pycode/test_pycode_parser.py:211–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209
210
211def test_nested_function() -> None:
212 source = (
213 'def some_function():\n'
214 ' a = 1 + 1 #: comment1\n'
215 '\n'
216 ' def inner_function():\n'
217 ' b = 1 + 1 #: comment2\n'
218 )
219 parser = Parser(source)
220 parser.parse()
221 assert parser.comments == {}
222 assert parser.definitions == {'some_function': ('def', 1, 5)}
223 assert parser.deforders == {'some_function': 0}
224
225
226def test_class() -> None:

Callers

nothing calls this directly

Calls 2

parseMethod · 0.95
ParserClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…