diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-01-19 23:09:46 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-01-19 23:09:46 +0900 |
commit | 4e257a8084c86957360ed397d252b69ed749a287 (patch) | |
tree | b1f85301738788c47d805b6d084202e3e73e865b /tests/test_autodoc.py | |
parent | 53e38ccc30419cc3466e6f128ced924c4824653e (diff) | |
parent | 334d23f88079b2bceef37af23170815736f23ef7 (diff) | |
download | sphinx-git-4e257a8084c86957360ed397d252b69ed749a287.tar.gz |
Merge branch '2.0' into 7023_partial_listed_as_module_members
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r-- | tests/test_autodoc.py | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 6d33caf35..6ee2c6ea9 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -1341,11 +1341,39 @@ def test_partialmethod(app): ' Make a cell alive.', ' ', ' ', - ' .. py:method:: Cell.set_dead()', + ' .. py:method:: Cell.set_state(state)', ' :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)', ' :module: target.partialmethod', @@ -1354,7 +1382,8 @@ def test_partialmethod(app): ' ', ] - options = {"members": None} + options = {"members": None, + "undoc-members": None} actual = do_autodoc(app, 'class', 'target.partialmethod.Cell', options) assert list(actual) == expected |