summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-23 08:54:35 +0300
committerYury Selivanov <yselivanov@sprymix.com>2015-07-23 08:54:35 +0300
commit2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3 (patch)
tree6c8fc0a96b616e02eab21f54afc4ba3dc6741235 /Lib/test
parent943ddac14227bf9cdd224903bc5f5696997a0129 (diff)
downloadcpython-git-2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3.tar.gz
Issue #24688: ast.get_docstring() for 'async def' functions.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_ast.py3
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})