()
| 194 | |
| 195 | |
| 196 | def test_function() -> None: |
| 197 | source = ( |
| 198 | 'def some_function():\n' |
| 199 | ' """docstring"""\n' |
| 200 | ' a = 1 + 1 #: comment1\n' |
| 201 | '\n' |
| 202 | ' b = a #: comment2\n' |
| 203 | ) |
| 204 | parser = Parser(source) |
| 205 | parser.parse() |
| 206 | assert parser.comments == {} |
| 207 | assert parser.definitions == {'some_function': ('def', 1, 5)} |
| 208 | assert parser.deforders == {'some_function': 0} |
| 209 | |
| 210 | |
| 211 | def test_nested_function() -> None: |