summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorBen Darnell <ben@bendarnell.com>2014-01-20 11:54:51 -0500
committerBen Darnell <ben@bendarnell.com>2014-01-20 11:54:51 -0500
commit3ed243de54759e312dddeb9f74e715d25e80f755 (patch)
treef141e7ded1552bf7c55257df3e13f498a8678d3f /tests/test_autodoc.py
parent8115aa81a2972a5cc20b8d7c244c52e792ecad98 (diff)
downloadsphinx-git-3ed243de54759e312dddeb9f74e715d25e80f755.tar.gz
Fix an exception introduced by b69b59480cba for __init__ with no docstring.
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 82eb0f716..3d30d0dd8 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -348,6 +348,22 @@ def test_get_doc():
directive.env.config.autoclass_content = 'both'
assert getdocl('class', F) == ['Class docstring']
+ # class has __init__ method with no docstring
+ class G(object):
+ """Class docstring"""
+ def __init__(self):
+ pass
+
+ # docstring in the __init__ method of base class will not be used
+ for f in (False, True):
+ directive.env.config.autodoc_docstring_signature = f
+ directive.env.config.autoclass_content = 'class'
+ assert getdocl('class', G) == ['Class docstring']
+ directive.env.config.autoclass_content = 'init'
+ assert getdocl('class', G) == ['Class docstring']
+ directive.env.config.autoclass_content = 'both'
+ assert getdocl('class', G) == ['Class docstring']
+
@with_setup(setup_test)
def test_docstring_processing():