Added test for correct nested class name when show-inheritance enabled

This commit is contained in:
Brendt Wohlberg 2018-12-02 08:36:31 -07:00
parent 820a71a8fc
commit aacf2b8e65
2 changed files with 17 additions and 0 deletions

View File

@ -163,6 +163,10 @@ class Outer(object):
factory = dict
class InnerChild(Outer.Inner):
"""InnerChild docstring"""
class DocstringSig(object):
def meth(self):
"""meth(FOO, BAR=1) -> BAZ

View File

@ -824,6 +824,7 @@ def test_autodoc_ignore_module_all(app):
'.. py:class:: CustomDataDescriptor2(doc)',
'.. py:class:: CustomDataDescriptorMeta',
'.. py:class:: CustomDict',
'.. py:class:: InnerChild',
'.. py:class:: InstAttCls()',
'.. py:class:: Outer',
' .. py:class:: Outer.Inner',
@ -914,6 +915,18 @@ def test_autodoc_inner_class(app):
' ',
]
options['show-inheritance'] = True
actual = do_autodoc(app, 'class', 'target.InnerChild', options)
assert list(actual) == [
'',
'.. py:class:: InnerChild',
' :module: target', '',
' Bases: :class:`target.Outer.Inner`',
'',
' InnerChild docstring',
' '
]
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autodoc_descriptor(app):