summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2014-01-15 05:25:56 +0000
committershimizukawa <shimizukawa@gmail.com>2014-01-15 05:25:56 +0000
commitf458a7f06e8f18d446fc0bf7cb397b777cf1ef1d (patch)
treeb436c36a949d036d656363ad0e24b91ca8a39a4d /tests/test_autodoc.py
parent8b375619a7a91d26f07f1ba944757700ae82827f (diff)
parentcbe7cad734728bdeee093066005c36e1598fa37e (diff)
downloadsphinx-f458a7f06e8f18d446fc0bf7cb397b777cf1ef1d.tar.gz
merge heads
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index 7e60c5fb..82eb0f71 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -334,6 +334,20 @@ def test_get_doc():
directive.env.config.autoclass_content = 'both'
assert getdocl('class', E) == ['Class docstring', '', 'Init docstring']
+ # class does not have __init__ method
+ class F(object):
+ """Class docstring"""
+
+ # docstring in the __init__ method of base class will be discard
+ for f in (False, True):
+ directive.env.config.autodoc_docstring_signature = f
+ directive.env.config.autoclass_content = 'class'
+ assert getdocl('class', F) == ['Class docstring']
+ directive.env.config.autoclass_content = 'init'
+ assert getdocl('class', F) == ['Class docstring']
+ directive.env.config.autoclass_content = 'both'
+ assert getdocl('class', F) == ['Class docstring']
+
@with_setup(setup_test)
def test_docstring_processing():