Fix #6567: autodoc: autodoc_inherit_docstrings does not effect to __init__()

This commit is contained in:
Takeshi KOMIYA
2019-07-10 02:07:40 +09:00
parent 5d89c30dab
commit 1c088ec163
4 changed files with 60 additions and 4 deletions

View File

@@ -62,6 +62,18 @@ def test_autoclass_content_class(app):
' :module: target.autoclass_content',
'',
' A class having both __init__ and __new__',
' ',
'',
'.. py:class:: G()',
' :module: target.autoclass_content',
'',
' A class inherits __init__ without docstring.',
' ',
'',
'.. py:class:: H()',
' :module: target.autoclass_content',
'',
' A class inherits __new__ without docstring.',
' '
]
@@ -110,6 +122,18 @@ def test_autoclass_content_init(app):
' :module: target.autoclass_content',
'',
' __init__ docstring',
' ',
'',
'.. py:class:: G()',
' :module: target.autoclass_content',
'',
' __init__ docstring',
' ',
'',
'.. py:class:: H()',
' :module: target.autoclass_content',
'',
' __new__ docstring',
' '
]
@@ -164,6 +188,22 @@ def test_autoclass_content_both(app):
' A class having both __init__ and __new__',
' ',
' __init__ docstring',
' ',
'',
'.. py:class:: G()',
' :module: target.autoclass_content',
'',
' A class inherits __init__ without docstring.',
' ',
' __init__ docstring',
' ',
'',
'.. py:class:: H()',
' :module: target.autoclass_content',
'',
' A class inherits __new__ without docstring.',
' ',
' __new__ docstring',
' '
]