mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #24688: ast.get_docstring() for 'async def' functions.
This commit is contained in:
parent
943ddac142
commit
2f07a66ded
3 changed files with 6 additions and 1 deletions
|
@ -511,6 +511,9 @@ class ASTHelpers_Test(unittest.TestCase):
|
|||
self.assertEqual(ast.get_docstring(node.body[0]),
|
||||
'line one\nline two')
|
||||
|
||||
node = ast.parse('async def foo():\n """spam\n ham"""')
|
||||
self.assertEqual(ast.get_docstring(node.body[0]), 'spam\nham')
|
||||
|
||||
def test_literal_eval(self):
|
||||
self.assertEqual(ast.literal_eval('[1, 2, 3]'), [1, 2, 3])
|
||||
self.assertEqual(ast.literal_eval('{"foo": 42}'), {"foo": 42})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue