summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-05 01:20:33 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-05 01:20:33 +0900
commit2be6aaa7a45d5589aecbe36dfa7911c3bdbecff7 (patch)
tree07d7bb4ac67730a47992e04b01e8113dfa2226e6
parent44fbd005850b2d8681cb4cd9d88dca9686ecb340 (diff)
parent3171fd709a6114cb99a448bda0dd3abe1859064c (diff)
downloadsphinx-git-2be6aaa7a45d5589aecbe36dfa7911c3bdbecff7.tar.gz
Merge branch '3.3.x' into 3.x
-rw-r--r--.github/workflows/main.yml5
-rw-r--r--.travis.yml3
-rw-r--r--tests/test_ext_autodoc.py33
-rw-r--r--tests/test_ext_autodoc_autofunction.py29
4 files changed, 43 insertions, 27 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 1750a764a..a85e3c8fb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -8,8 +8,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- name: [py36, py37]
+ name: [py35, py36, py37]
include:
+ - name: py35
+ python: 3.5
+ docutils: du12
- name: py36
python: 3.6
docutils: du13
diff --git a/.travis.yml b/.travis.yml
index 8e971a356..4123ba6b5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,9 +11,6 @@ env:
jobs:
include:
- - python: '3.5'
- env:
- - TOXENV=du12
- python: '3.8'
env:
- TOXENV=du15
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),
diff --git a/tests/test_ext_autodoc_autofunction.py b/tests/test_ext_autodoc_autofunction.py
index bb292bc6a..1f68c0319 100644
--- a/tests/test_ext_autodoc_autofunction.py
+++ b/tests/test_ext_autodoc_autofunction.py
@@ -9,6 +9,8 @@
:license: BSD, see LICENSE for details.
"""
+import sys
+
import pytest
from test_ext_autodoc import do_autodoc
@@ -108,16 +110,23 @@ def test_decorated(app):
def test_singledispatch(app):
options = {}
actual = do_autodoc(app, 'function', 'target.singledispatch.func', options)
- assert list(actual) == [
- '',
- '.. 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: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.sphinx('html', testroot='ext-autodoc')