Remove redundant code for Python < 3.6

This commit is contained in:
Hugo van Kemenade
2022-05-01 17:50:34 +03:00
parent 2f29f0a96e
commit 184fe83c73
5 changed files with 19 additions and 34 deletions

View File

@@ -2452,7 +2452,6 @@ def test_type_union_operator(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_hide_value(app):
options = {'members': None}

View File

@@ -39,7 +39,6 @@ def test_autoattribute_novalue(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autoattribute_typed_variable(app):
actual = do_autodoc(app, 'attribute', 'target.typed_vars.Class.attr2')
@@ -52,7 +51,6 @@ def test_autoattribute_typed_variable(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autoattribute_typed_variable_in_alias(app):
actual = do_autodoc(app, 'attribute', 'target.typed_vars.Alias.attr2')
@@ -65,7 +63,6 @@ def test_autoattribute_typed_variable_in_alias(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autoattribute_instance_variable(app):
actual = do_autodoc(app, 'attribute', 'target.typed_vars.Class.attr4')
@@ -80,7 +77,6 @@ def test_autoattribute_instance_variable(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autoattribute_instance_variable_in_alias(app):
actual = do_autodoc(app, 'attribute', 'target.typed_vars.Alias.attr4')
@@ -198,7 +194,6 @@ def test_autoattribute_TypeVar(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autoattribute_hide_value(app):
actual = do_autodoc(app, 'attribute', 'target.hide_value.Foo.SENTINEL1')

View File

@@ -102,7 +102,6 @@ def test_inherited_instance_variable(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='py36+ is available since python3.6.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_uninitialized_attributes(app):
options = {"members": None,
@@ -130,7 +129,6 @@ def test_uninitialized_attributes(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='py36+ is available since python3.6.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_undocumented_uninitialized_attributes(app):
options = {"members": None,

View File

@@ -39,7 +39,6 @@ def test_autodata_novalue(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autodata_typed_variable(app):
actual = do_autodoc(app, 'data', 'target.typed_vars.attr2')
@@ -54,7 +53,6 @@ def test_autodata_typed_variable(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autodata_type_comment(app):
actual = do_autodoc(app, 'data', 'target.typed_vars.attr3')
@@ -126,7 +124,6 @@ def test_autodata_TypeVar(app):
]
@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autodata_hide_value(app):
actual = do_autodoc(app, 'data', 'target.hide_value.SENTINEL1')

View File

@@ -1,7 +1,6 @@
"""Tests for :mod:`sphinx.ext.napoleon.docstring` module."""
import re
import sys
from collections import namedtuple
from contextlib import contextmanager
from inspect import cleandoc
@@ -15,7 +14,6 @@ from sphinx.ext.napoleon.docstring import (GoogleDocstring, NumpyDocstring,
_convert_numpy_type_spec, _recombine_set_tokens,
_token_type, _tokenize_type_spec)
if sys.version_info >= (3, 6):
from .ext_napoleon_pep526_data_google import PEP526GoogleClass
from .ext_napoleon_pep526_data_numpy import PEP526NumpyClass
@@ -1162,7 +1160,6 @@ Do as you please
self.assertEqual(expected, actual)
def test_pep526_annotations(self):
if sys.version_info >= (3, 6):
# Test class attributes annotations
config = Config(
napoleon_attr_annotations=True
@@ -2573,7 +2570,6 @@ class TestNumpyDocstring:
assert actual == expected
def test_pep526_annotations(self):
if sys.version_info >= (3, 6):
# test class attributes annotations
config = Config(
napoleon_attr_annotations=True