diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-01 22:15:10 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-07 17:50:10 +0900 |
commit | 8f7cc26b208ae9e477a95c8daf5e690e49945ad5 (patch) | |
tree | 835a2de18b59035a9e37e2fd46ba4064b8a9a13a /tests/test_autodoc.py | |
parent | 961b4d1545eb5174617d8c3251006cc19f420088 (diff) | |
download | sphinx-git-8f7cc26b208ae9e477a95c8daf5e690e49945ad5.tar.gz |
autodoc: Support singledispatch methods
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r-- | tests/test_autodoc.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index dcbdc6d3a..0510fff86 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -1582,3 +1582,30 @@ def test_singledispatch(): ' A function for general use.', ' ' ] + + +@pytest.mark.skipif(sys.version_info < (3, 8), + reason='singledispatchmethod is available since python3.8') +@pytest.mark.usefixtures('setup_test') +def test_singledispatchmethod(): + options = {"members": None} + actual = do_autodoc(app, 'module', 'target.singledispatchmethod', options) + assert list(actual) == [ + '', + '.. py:module:: target.singledispatchmethod', + '', + '', + '.. py:class:: Foo', + ' :module: target.singledispatchmethod', + '', + ' docstring', + ' ', + ' ', + ' .. py:method:: Foo.meth(arg, kwarg=None)', + ' Foo.meth(arg: int, kwarg=None)', + ' Foo.meth(arg: str, kwarg=None)', + ' :module: target.singledispatchmethod', + ' ', + ' A method for general use.', + ' ' + ] |