mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7030 from tk0miya/7023_testcase_for_partialmethod_not_having_docstring
Add testcase a partialmethod not having docstring (refs: #7023)
This commit is contained in:
commit
2adc12edb3
@ -14,5 +14,5 @@ class Cell(object):
|
|||||||
#: Make a cell alive.
|
#: Make a cell alive.
|
||||||
set_alive = partialmethod(set_state, True)
|
set_alive = partialmethod(set_state, True)
|
||||||
|
|
||||||
|
# a partialmethod with no docstring
|
||||||
set_dead = partialmethod(set_state, False)
|
set_dead = partialmethod(set_state, False)
|
||||||
"""Make a cell dead."""
|
|
||||||
|
@ -1324,10 +1324,38 @@ def test_partialmethod(app):
|
|||||||
' Make a cell alive.',
|
' Make a cell alive.',
|
||||||
' ',
|
' ',
|
||||||
' ',
|
' ',
|
||||||
' .. py:method:: Cell.set_dead()',
|
' .. py:method:: Cell.set_state(state)',
|
||||||
' :module: target.partialmethod',
|
' :module: target.partialmethod',
|
||||||
' ',
|
' ',
|
||||||
' Make a cell dead.',
|
' Update state of cell to *state*.',
|
||||||
|
' ',
|
||||||
|
]
|
||||||
|
|
||||||
|
options = {"members": None}
|
||||||
|
actual = do_autodoc(app, 'class', 'target.partialmethod.Cell', options)
|
||||||
|
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)',
|
' .. py:method:: Cell.set_state(state)',
|
||||||
@ -1337,7 +1365,8 @@ def test_partialmethod(app):
|
|||||||
' ',
|
' ',
|
||||||
]
|
]
|
||||||
|
|
||||||
options = {"members": None}
|
options = {"members": None,
|
||||||
|
"undoc-members": None}
|
||||||
actual = do_autodoc(app, 'class', 'target.partialmethod.Cell', options)
|
actual = do_autodoc(app, 'class', 'target.partialmethod.Cell', options)
|
||||||
assert list(actual) == expected
|
assert list(actual) == expected
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user