summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-08 11:38:39 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-22 16:31:07 +0900
commitb18fe13f550e58cd9b65246ceda8618a760b84c8 (patch)
tree2a922a706543c092f31e6cc3019edc1a15c92137 /tests
parent271ea125f2e5c3c21b39e5fa6edfc4b6dbcf0d26 (diff)
downloadsphinx-git-b18fe13f550e58cd9b65246ceda8618a760b84c8.tar.gz
Drop branches for sys.version_info < (3, 4)
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py8
-rw-r--r--tests/py35/test_autodoc_py35.py22
-rw-r--r--tests/test_autodoc.py2
-rw-r--r--tests/test_build.py5
-rw-r--r--tests/test_docutilsconf.py4
-rw-r--r--tests/test_util_inspect.py34
6 files changed, 12 insertions, 63 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 9f46b1868..65142d84a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -9,7 +9,6 @@
import os
import shutil
-import sys
import docutils
import pytest
@@ -22,13 +21,6 @@ pytest_plugins = 'sphinx.testing.fixtures'
# Exclude 'roots' dirs for pytest test collector
collect_ignore = ['roots']
-# Disable Python version-specific
-if sys.version_info < (3,):
- collect_ignore += ['py3']
-
-if sys.version_info < (3, 5):
- collect_ignore += ['py35']
-
@pytest.fixture(scope='session')
def rootdir():
diff --git a/tests/py35/test_autodoc_py35.py b/tests/py35/test_autodoc_py35.py
index 5064970e6..dcaf665af 100644
--- a/tests/py35/test_autodoc_py35.py
+++ b/tests/py35/test_autodoc_py35.py
@@ -10,11 +10,7 @@
:license: BSD, see LICENSE for details.
"""
-# "raises" imported for usage by autodoc
-import sys
-
import pytest
-import six
from docutils.statemachine import ViewList
from six import StringIO
@@ -207,11 +203,8 @@ def test_generate():
('attribute', 'test_autodoc_py35.Class.inst_attr_inline'),
('attribute', 'test_autodoc_py35.Class.inst_attr_string'),
('method', 'test_autodoc_py35.Class.moore'),
+ ('method', 'test_autodoc_py35.Class.do_coroutine'),
])
- if six.PY3 and sys.version_info[:2] >= (3, 5):
- should.extend([
- ('method', 'test_autodoc_py35.Class.do_coroutine'),
- ])
options.members = ALL
assert_processes(should, 'class', 'Class')
options.undoc_members = True
@@ -280,9 +273,8 @@ class Base(object):
"""Inherited function."""
-if six.PY3 and sys.version_info[:2] >= (3, 5):
- async def _other_coro_func():
- return "run"
+async def _other_coro_func():
+ return "run"
class Class(Base):
@@ -341,8 +333,6 @@ class Class(Base):
# undocumented special method
pass
- if six.PY3 and sys.version_info[:2] >= (3, 5):
-
- async def do_coroutine(self):
- """A documented coroutine function"""
- attr_coro_result = await _other_coro_func() # NOQA
+ async def do_coroutine(self):
+ """A documented coroutine function"""
+ attr_coro_result = await _other_coro_func() # NOQA
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index c9ca57350..0450c4c4a 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -1426,8 +1426,6 @@ def test_partialfunction():
assert call_autodoc('module', 'target.partialfunction') == expected
-@pytest.mark.skipif(sys.version_info < (3, 4),
- reason='functools.partialmethod is available on py34 or above')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_partialmethod(app):
expected = [
diff --git a/tests/test_build.py b/tests/test_build.py
index 47d76b2a2..e608797b9 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -33,11 +33,6 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
# If supported, build in a non-ASCII source dir
test_name = u'\u65e5\u672c\u8a9e'
basedir = sphinx_test_tempdir / request.node.originalname
- # Windows with versions prior to 3.2 (I think) doesn't support unicode on system path
- # so we force a non-unicode path in that case
- if (sys.platform == "win32" and
- not (sys.version_info.major >= 3 and sys.version_info.minor >= 2)):
- return basedir / 'all'
try:
srcdir = basedir / test_name
if not srcdir.exists():
diff --git a/tests/test_docutilsconf.py b/tests/test_docutilsconf.py
index 989edc6a8..32a2aad29 100644
--- a/tests/test_docutilsconf.py
+++ b/tests/test_docutilsconf.py
@@ -10,7 +10,6 @@
"""
import re
-import sys
import pytest
@@ -82,9 +81,6 @@ def test_texinfo(app, status, warning):
@pytest.mark.sphinx('html', testroot='docutilsconf',
docutilsconf='[general]\nsource_link=true\n')
-@pytest.mark.skip(sys.platform == "win32" and
- not (sys.version_info.major >= 3 and sys.version_info.minor >= 2),
- reason="Python < 3.2 on Win32 doesn't handle non-ASCII paths right")
def test_docutils_source_link_with_nonascii_file(app, status, warning):
srcdir = path(app.srcdir)
mb_name = u'\u65e5\u672c\u8a9e'
diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py
index 7266d4bbf..74864f41a 100644
--- a/tests/test_util_inspect.py
+++ b/tests/test_util_inspect.py
@@ -105,13 +105,8 @@ def test_getargspec_bound_methods():
pass
assert expected_unbound == inspect.getargspec(Foo.method)
- if PY3 and sys.version_info >= (3, 4, 4):
- # On py2, the inspect functions don't properly handle bound
- # methods (they include a spurious 'self' argument)
- assert expected_bound == inspect.getargspec(bound_method)
- # On py2, the inspect functions can't properly handle wrapped
- # functions (no __wrapped__ support)
- assert expected_bound == inspect.getargspec(wrapped_bound_method)
+ assert expected_bound == inspect.getargspec(bound_method)
+ assert expected_bound == inspect.getargspec(wrapped_bound_method)
def test_Signature():
@@ -143,10 +138,7 @@ def test_Signature_partial():
p = functools.partial(fun, 10, c=11)
sig = inspect.Signature(p).format_args()
- if sys.version_info < (3,):
- assert sig == '(b, d=2)'
- else:
- assert sig == '(b, *, c=11, d=2)'
+ assert sig == '(b, *, c=11, d=2)'
def test_Signature_methods():
@@ -193,16 +185,9 @@ def test_Signature_methods():
# wrapped bound method
sig = inspect.Signature(wrapped_bound_method).format_args()
- if sys.version_info < (3,):
- assert sig == '(*args, **kwargs)'
- elif sys.version_info < (3, 4, 4):
- assert sig == '(self, arg1, **kwargs)'
- else:
- assert sig == '(arg1, **kwargs)'
+ assert sig == '(arg1, **kwargs)'
-@pytest.mark.skipif(sys.version_info < (3, 4),
- reason='functools.partialmethod is available on py34 or above')
def test_Signature_partialmethod():
from functools import partialmethod
@@ -228,8 +213,6 @@ def test_Signature_partialmethod():
assert sig == '()'
-@pytest.mark.skipif(sys.version_info < (3, 4),
- reason='type annotation test is available on py34 or above')
def test_Signature_annotations():
from typing_test_data import (
f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, Node)
@@ -437,10 +420,5 @@ def test_isstaticmethod():
assert inspect.isstaticmethod(Foo.method1, Foo, 'method1') is True
assert inspect.isstaticmethod(Foo.method2, Foo, 'method2') is False
-
- if sys.version_info < (3, 0):
- assert inspect.isstaticmethod(Bar.method1, Bar, 'method1') is False
- assert inspect.isstaticmethod(Bar.method2, Bar, 'method2') is False
- else:
- assert inspect.isstaticmethod(Bar.method1, Bar, 'method1') is True
- assert inspect.isstaticmethod(Bar.method2, Bar, 'method2') is False
+ assert inspect.isstaticmethod(Bar.method1, Bar, 'method1') is True
+ assert inspect.isstaticmethod(Bar.method2, Bar, 'method2') is False