diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-11-05 02:21:47 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-11-05 02:21:47 +0900 |
commit | 8bf84167a30aa05886fcc1ed8895c8c20e939d89 (patch) | |
tree | 51252d17e9c5a344395d64fe4225759cb04f1f4c /tests/test_ext_autodoc.py | |
parent | b93aa3137af650ea01f3a68bb14e822bffe81309 (diff) | |
parent | ab707be1e1def8c904b5df0c5ddeaf2edacca0f6 (diff) | |
download | sphinx-git-8bf84167a30aa05886fcc1ed8895c8c20e939d89.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'tests/test_ext_autodoc.py')
-rw-r--r-- | tests/test_ext_autodoc.py | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py index c0676f23f..703cc13f6 100644 --- a/tests/test_ext_autodoc.py +++ b/tests/test_ext_autodoc.py @@ -1832,19 +1832,26 @@ def test_autodoc_for_egged_code(app): def test_singledispatch(app): options = {"members": None} actual = do_autodoc(app, 'module', 'target.singledispatch', options) - assert list(actual) == [ - '', - '.. py:module:: target.singledispatch', - '', - '', - '.. py:function:: func(arg, kwarg=None)', - ' func(arg: int, kwarg=None)', - ' func(arg: str, kwarg=None)', - ' :module: target.singledispatch', - '', - ' A function for general use.', - '', - ] + if sys.version_info < (3, 6): + # check the result via "in" because the order of singledispatch signatures is + # usually changed (because dict is not OrderedDict yet!) + assert '.. py:function:: func(arg, kwarg=None)' in actual + assert ' func(arg: int, kwarg=None)' in actual + assert ' func(arg: str, kwarg=None)' in actual + else: + assert list(actual) == [ + '', + '.. py:module:: target.singledispatch', + '', + '', + '.. py:function:: func(arg, kwarg=None)', + ' func(arg: int, kwarg=None)', + ' func(arg: str, kwarg=None)', + ' :module: target.singledispatch', + '', + ' A function for general use.', + '', + ] @pytest.mark.skipif(sys.version_info < (3, 8), |