summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-07-06 19:21:19 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2019-07-06 19:21:19 +0300
commit34bd44419112229e2e7aadaf43f3822cff9556c7 (patch)
treee04f13d789b43faee59d9d26995cf630b20e1ac2
parent807cbaa17c8a7066c673b35d3c87c97cdaeb3a5f (diff)
downloadastroid-git-34bd44419112229e2e7aadaf43f3822cff9556c7.tar.gz
Add test for extracting a doc to make sure we have it working on Python 3.8
-rw-r--r--astroid/tests/unittest_nodes.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/astroid/tests/unittest_nodes.py b/astroid/tests/unittest_nodes.py
index 96a7f830..8e0a23a4 100644
--- a/astroid/tests/unittest_nodes.py
+++ b/astroid/tests/unittest_nodes.py
@@ -1159,5 +1159,16 @@ def test_assignment_expression():
assert second.as_string() == "b := test"
+def test_get_doc():
+ node = astroid.extract_node(
+ """
+ def func():
+ "Docstring"
+ return 1
+ """
+ )
+ assert node.doc == "Docstring"
+
+
if __name__ == "__main__":
unittest.main()