mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added test for correct nested class name when show-inheritance enabled
This commit is contained in:
parent
820a71a8fc
commit
aacf2b8e65
@ -163,6 +163,10 @@ class Outer(object):
|
|||||||
factory = dict
|
factory = dict
|
||||||
|
|
||||||
|
|
||||||
|
class InnerChild(Outer.Inner):
|
||||||
|
"""InnerChild docstring"""
|
||||||
|
|
||||||
|
|
||||||
class DocstringSig(object):
|
class DocstringSig(object):
|
||||||
def meth(self):
|
def meth(self):
|
||||||
"""meth(FOO, BAR=1) -> BAZ
|
"""meth(FOO, BAR=1) -> BAZ
|
||||||
|
@ -824,6 +824,7 @@ def test_autodoc_ignore_module_all(app):
|
|||||||
'.. py:class:: CustomDataDescriptor2(doc)',
|
'.. py:class:: CustomDataDescriptor2(doc)',
|
||||||
'.. py:class:: CustomDataDescriptorMeta',
|
'.. py:class:: CustomDataDescriptorMeta',
|
||||||
'.. py:class:: CustomDict',
|
'.. py:class:: CustomDict',
|
||||||
|
'.. py:class:: InnerChild',
|
||||||
'.. py:class:: InstAttCls()',
|
'.. py:class:: InstAttCls()',
|
||||||
'.. py:class:: Outer',
|
'.. py:class:: Outer',
|
||||||
' .. py:class:: Outer.Inner',
|
' .. 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')
|
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||||
def test_autodoc_descriptor(app):
|
def test_autodoc_descriptor(app):
|
||||||
|
Loading…
Reference in New Issue
Block a user