summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-03 22:51:33 +0100
committerGeorg Brandl <georg@python.org>2011-01-03 22:51:33 +0100
commitf6cb763ff8bdbe897d0a13bf0af2fd8f528f69b1 (patch)
tree3650cc4c33802e011a0b1f7941fadf12e4ef8e62 /tests/test_autodoc.py
parent594c1a90f4742cfc685089d905242806f2916500 (diff)
downloadsphinx-git-f6cb763ff8bdbe897d0a13bf0af2fd8f528f69b1.tar.gz
#564: Add :confval:`autodoc_docstring_signature` which retrieves the signature from the first line of the docstring, if it is found there.
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index d70fa2606..74e69a68c 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -492,6 +492,13 @@ def test_generate():
],
'class', 'Class', member_order='bysource', all_members=True)
+ # test autodoc_docstring_signature
+ assert_result_contains(
+ '.. py:method:: DocstringSig.meth(FOO, BAR=1) -> BAZ', 'method',
+ 'test_autodoc.DocstringSig.meth')
+ assert_result_contains(
+ ' rest of docstring', 'method', 'test_autodoc.DocstringSig.meth')
+
# --- generate fodder ------------
@@ -582,3 +589,12 @@ class Outer(object):
# should be documented as an alias
factory = dict
+
+
+class DocstringSig(object):
+ def meth(self):
+ """
+ meth(FOO, BAR=1) -> BAZ
+
+ rest of docstring
+ """