diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-23 08:54:35 +0300 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-23 08:54:35 +0300 |
commit | ddae2830cb3571b5209d6a5b0d48d366121d7518 (patch) | |
tree | 065365e1e96adceaa8b3ce9f823704f8f11c7335 /Lib/test/test_ast.py | |
parent | 7656275f7d973761d3b2627989cf874e55ef855d (diff) | |
download | cpython-ddae2830cb3571b5209d6a5b0d48d366121d7518.tar.gz |
Issue #24688: ast.get_docstring() for 'async def' functions.
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index c220a3cac2..7ed03e70e0 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -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}) |