mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
autodoc: Handle multiple inheritance correctly (#13136)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
@@ -831,6 +831,7 @@ def test_autodoc_inherited_members(app):
|
||||
}
|
||||
actual = do_autodoc(app, 'class', 'target.inheritance.Derived', options)
|
||||
assert list(filter(lambda l: 'method::' in l, actual)) == [
|
||||
' .. py:method:: Derived.another_inheritedmeth()',
|
||||
' .. py:method:: Derived.inheritedclassmeth()',
|
||||
' .. py:method:: Derived.inheritedmeth()',
|
||||
' .. py:method:: Derived.inheritedstaticmeth(cls)',
|
||||
|
@@ -134,6 +134,16 @@ def test_automodule_inherited_members(app):
|
||||
'.. py:module:: target.inheritance',
|
||||
'',
|
||||
'',
|
||||
'.. py:class:: AnotherBase()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
'',
|
||||
' .. py:method:: AnotherBase.another_inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
' Another inherited function.',
|
||||
'',
|
||||
'',
|
||||
'.. py:class:: Base()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
@@ -169,6 +179,12 @@ def test_automodule_inherited_members(app):
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
'',
|
||||
' .. py:method:: Derived.another_inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
' Another inherited function.',
|
||||
'',
|
||||
'',
|
||||
' .. py:method:: Derived.inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
|
@@ -319,6 +319,12 @@ def test_autodoc_inherit_docstrings_for_inherited_members(app):
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
'',
|
||||
' .. py:method:: Derived.another_inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
' Another inherited function.',
|
||||
'',
|
||||
'',
|
||||
' .. py:attribute:: Derived.inheritedattr',
|
||||
' :module: target.inheritance',
|
||||
' :value: None',
|
||||
@@ -356,6 +362,12 @@ def test_autodoc_inherit_docstrings_for_inherited_members(app):
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
'',
|
||||
' .. py:method:: Derived.another_inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
' Another inherited function.',
|
||||
'',
|
||||
'',
|
||||
' .. py:method:: Derived.inheritedclassmeth()',
|
||||
' :module: target.inheritance',
|
||||
' :classmethod:',
|
||||
|
Reference in New Issue
Block a user