summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-01-19 22:47:02 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-01-19 22:47:02 +0900
commit347e301727c3b2b08e277b0d8a72c33a1eba13d8 (patch)
tree8b0c32ac6d5bd84ce4a8746eff3ef54acec93830 /tests/test_autodoc.py
parentad271f4ca33d298a880da8fdc75cc318b4a7842f (diff)
parenteb273fdc08840945b9c2419f20fb2e0220b0a004 (diff)
downloadsphinx-git-347e301727c3b2b08e277b0d8a72c33a1eba13d8.tar.gz
Merge branch '2.0'
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py47
1 files changed, 41 insertions, 6 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index 819cbdcde..71ddb6624 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -1265,19 +1265,25 @@ def test_partialfunction():
'.. py:module:: target.partialfunction',
'',
'',
- '.. py:function:: func1()',
+ '.. py:function:: func1(a, b, c)',
' :module: target.partialfunction',
'',
' docstring of func1',
' ',
'',
- '.. py:function:: func2()',
+ '.. py:function:: func2(b, c)',
' :module: target.partialfunction',
'',
' docstring of func1',
' ',
'',
- '.. py:function:: func3()',
+ '.. py:function:: func3(c)',
+ ' :module: target.partialfunction',
+ '',
+ ' docstring of func3',
+ ' ',
+ '',
+ '.. py:function:: func4()',
' :module: target.partialfunction',
'',
' docstring of func3',
@@ -1348,12 +1354,40 @@ def test_partialmethod(app):
' Make a cell alive.',
' ',
' ',
- ' .. py:method:: Cell.set_dead()',
+ ' .. py:method:: Cell.set_state(state)',
+ ' :module: target.partialmethod',
+ ' ',
+ ' 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 dead.',
+ ' Make a cell alive.',
' ',
' ',
+ ' .. py:method:: Cell.set_dead()',
+ ' :module: target.partialmethod',
+ ' ',
+ ' ',
' .. py:method:: Cell.set_state(state)',
' :module: target.partialmethod',
' ',
@@ -1361,7 +1395,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