Remove some more Python 2/3.5 references

This commit is contained in:
Dave Halter
2020-07-02 00:24:51 +02:00
parent 50b85153ce
commit 7e295d05a1
8 changed files with 9 additions and 38 deletions

View File

@@ -34,6 +34,7 @@ from stub_folder.with_stub import in_
#? ['with_stub', 'stub_only', 'with_stub_folder', 'stub_only_folder']
from stub_folder.
# -------------------------
# Folders
# -------------------------

View File

@@ -144,9 +144,6 @@ def test_in_comment_before_string(Script):
def test_async(Script, environment):
if environment.version_info < (3, 5):
pytest.skip()
code = dedent('''
foo = 3
async def x():

View File

@@ -307,7 +307,6 @@ def test_endless_yield():
_assert_interpreter_complete('list(lst)[9000].rea', locals(), ['real'])
@pytest.mark.skipif('py_version < 33', reason='inspect.signature was created in 3.3.')
def test_completion_params():
foo = lambda a, b=3: None
@@ -320,7 +319,6 @@ def test_completion_params():
assert t.name == 'int'
@pytest.mark.skipif('py_version < 33', reason='inspect.signature was created in 3.3.')
def test_completion_param_annotations():
# Need to define this function not directly in Python. Otherwise Jedi is too
# clever and uses the Python code instead of the signature object.

View File

@@ -43,11 +43,6 @@ from test.helpers import root_dir
])
def test_infer_and_goto(Script, code, full_name, has_stub, has_python, way,
kwargs, type_, options, environment):
if environment.version_info < (3, 5):
# We just don't care about much of the detailed Python 2 failures
# anymore, because its end-of-life soon.
pytest.skip()
if type_ == 'infer' and full_name == 'typing.Sequence' and environment.version_info >= (3, 7):
# In Python 3.7+ there's not really a sequence definition, there's just
# a name that leads nowhere.

View File

@@ -21,13 +21,6 @@ def test_get_typeshed_directories():
def transform(set_):
return {x.replace('/', os.path.sep) for x in set_}
dirs = get_dirs(PythonVersionInfo(2, 7))
assert dirs == transform({'stdlib/2and3', 'stdlib/2', 'third_party/2and3', 'third_party/2'})
dirs = get_dirs(PythonVersionInfo(3, 5))
assert dirs == transform({'stdlib/2and3', 'stdlib/3',
'third_party/2and3', 'third_party/3'})
dirs = get_dirs(PythonVersionInfo(3, 6))
assert dirs == transform({'stdlib/2and3', 'stdlib/3',
'stdlib/3.6', 'third_party/2and3',

View File

@@ -1,17 +1,7 @@
from os.path import dirname
import pytest
from test.helpers import get_example_dir, example_dir
from jedi import Project
@pytest.fixture(autouse=True)
def skip_not_supported_versions(environment):
if environment.version_info < (3, 5):
pytest.skip()
def test_implicit_namespace_package(Script):
sys_path = [get_example_dir('implicit_namespace_package', 'ns1'),
get_example_dir('implicit_namespace_package', 'ns2')]

View File

@@ -80,9 +80,6 @@ def test_relative_import(Script, environment, tmpdir):
"""
Attempt a relative import in a very simple namespace package.
"""
if environment.version_info < (3, 5):
pytest.skip()
directory = get_example_dir('namespace_package_relative_import')
# Need to copy the content in a directory where there's no __init__.py.
py.path.local(directory).copy(tmpdir)

View File

@@ -11,21 +11,21 @@ from ..helpers import get_example_dir
@pytest.mark.parametrize(
'code, sig, names, op, version', [
('import math; math.cos', 'cos(x, /)', ['x'], ge, (2, 7)),
('import math; math.cos', 'cos(x, /)', ['x'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (2, 7)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (3, 6)),
('str', "str(object='', /) -> str", ['object'], ge, (2, 7)),
('str', "str(object='', /) -> str", ['object'], ge, (3, 6)),
('pow', 'pow(x, y, z=None, /) -> number', ['x', 'y', 'z'], lt, (3, 5)),
('pow', 'pow(x, y, z=None, /) -> number', ['x', 'y', 'z'], lt, (3, 6)),
('pow', 'pow(base, exp, mod=None)', ['base', 'exp', 'mod'], ge, (3, 8)),
('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)',
['self', 'sep'], lt, (3, 5)),
('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 5)),
['self', 'sep'], lt, (3, 6)),
('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 6)),
('bytes().partition', 'partition(sep, /) -> (head, sep, tail)', ['sep'], lt, (3, 5)),
('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 5)),
('bytes().partition', 'partition(sep, /) -> (head, sep, tail)', ['sep'], lt, (3, 6)),
('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 6)),
]
)
def test_compiled_signature(Script, environment, code, sig, names, op, version):