mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
test: Update testcase for autodoc_inherit_docstrings
This commit is contained in:
@@ -18,6 +18,30 @@ from test_autodoc import do_autodoc
|
||||
IS_PYPY = platform.python_implementation() == 'PyPy'
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_autodoc_inherit_docstrings(app):
|
||||
assert app.config.autodoc_inherit_docstrings is True # default
|
||||
actual = do_autodoc(app, 'method', 'target.inheritance.Derived.inheritedmeth')
|
||||
assert list(actual) == [
|
||||
'',
|
||||
'.. py:method:: Derived.inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
'',
|
||||
' Inherited function.',
|
||||
' '
|
||||
]
|
||||
|
||||
# disable autodoc_inherit_docstrings
|
||||
app.config.autodoc_inherit_docstrings = False
|
||||
actual = do_autodoc(app, 'method', 'target.inheritance.Derived.inheritedmeth')
|
||||
assert list(actual) == [
|
||||
'',
|
||||
'.. py:method:: Derived.inheritedmeth()',
|
||||
' :module: target.inheritance',
|
||||
''
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_autodoc_docstring_signature(app):
|
||||
options = {"members": None}
|
||||
|
Reference in New Issue
Block a user