mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add testcase a partialmethod not having docstring (refs: #7023)
This commit is contained in:
parent
ef811532c9
commit
7906a6871e
@ -14,5 +14,5 @@ class Cell(object):
|
||||
#: Make a cell alive.
|
||||
set_alive = partialmethod(set_state, True)
|
||||
|
||||
# a partialmethod with no docstring
|
||||
set_dead = partialmethod(set_state, False)
|
||||
"""Make a cell dead."""
|
||||
|
@ -1324,12 +1324,6 @@ def test_partialmethod(app):
|
||||
' Make a cell alive.',
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: Cell.set_dead()',
|
||||
' :module: target.partialmethod',
|
||||
' ',
|
||||
' Make a cell dead.',
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: Cell.set_state(state)',
|
||||
' :module: target.partialmethod',
|
||||
' ',
|
||||
@ -1342,6 +1336,41 @@ def test_partialmethod(app):
|
||||
assert list(actual) == expected
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_partialmethod_undoc_members(app):
|
||||
expected = [
|
||||
'',
|
||||
'.. py:class:: Cell',
|
||||
' :module: target.partialmethod',
|
||||
'',
|
||||
' An example for partialmethod.',
|
||||
' ',
|
||||
' refs: https://docs.python.jp/3/library/functools.html#functools.partialmethod',
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: Cell.set_alive()',
|
||||
' :module: target.partialmethod',
|
||||
' ',
|
||||
' Make a cell alive.',
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: Cell.set_dead()',
|
||||
' :module: target.partialmethod',
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: Cell.set_state(state)',
|
||||
' :module: target.partialmethod',
|
||||
' ',
|
||||
' Update state of cell to *state*.',
|
||||
' ',
|
||||
]
|
||||
|
||||
options = {"members": None,
|
||||
"undoc-members": None}
|
||||
actual = do_autodoc(app, 'class', 'target.partialmethod.Cell', options)
|
||||
assert list(actual) == expected
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='pycode-egg')
|
||||
def test_autodoc_for_egged_code(app):
|
||||
options = {"members": None,
|
||||
|
Loading…
Reference in New Issue
Block a user