forked from VimPlug/jedi
Remove some more Python 2/3.5 references
This commit is contained in:
@@ -34,6 +34,7 @@ from stub_folder.with_stub import in_
|
|||||||
#? ['with_stub', 'stub_only', 'with_stub_folder', 'stub_only_folder']
|
#? ['with_stub', 'stub_only', 'with_stub_folder', 'stub_only_folder']
|
||||||
from stub_folder.
|
from stub_folder.
|
||||||
|
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Folders
|
# Folders
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|||||||
@@ -144,9 +144,6 @@ def test_in_comment_before_string(Script):
|
|||||||
|
|
||||||
|
|
||||||
def test_async(Script, environment):
|
def test_async(Script, environment):
|
||||||
if environment.version_info < (3, 5):
|
|
||||||
pytest.skip()
|
|
||||||
|
|
||||||
code = dedent('''
|
code = dedent('''
|
||||||
foo = 3
|
foo = 3
|
||||||
async def x():
|
async def x():
|
||||||
|
|||||||
@@ -307,7 +307,6 @@ def test_endless_yield():
|
|||||||
_assert_interpreter_complete('list(lst)[9000].rea', locals(), ['real'])
|
_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():
|
def test_completion_params():
|
||||||
foo = lambda a, b=3: None
|
foo = lambda a, b=3: None
|
||||||
|
|
||||||
@@ -320,7 +319,6 @@ def test_completion_params():
|
|||||||
assert t.name == 'int'
|
assert t.name == 'int'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif('py_version < 33', reason='inspect.signature was created in 3.3.')
|
|
||||||
def test_completion_param_annotations():
|
def test_completion_param_annotations():
|
||||||
# Need to define this function not directly in Python. Otherwise Jedi is too
|
# Need to define this function not directly in Python. Otherwise Jedi is too
|
||||||
# clever and uses the Python code instead of the signature object.
|
# clever and uses the Python code instead of the signature object.
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ from test.helpers import root_dir
|
|||||||
])
|
])
|
||||||
def test_infer_and_goto(Script, code, full_name, has_stub, has_python, way,
|
def test_infer_and_goto(Script, code, full_name, has_stub, has_python, way,
|
||||||
kwargs, type_, options, environment):
|
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):
|
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
|
# In Python 3.7+ there's not really a sequence definition, there's just
|
||||||
# a name that leads nowhere.
|
# a name that leads nowhere.
|
||||||
|
|||||||
@@ -21,13 +21,6 @@ def test_get_typeshed_directories():
|
|||||||
def transform(set_):
|
def transform(set_):
|
||||||
return {x.replace('/', os.path.sep) for x in 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))
|
dirs = get_dirs(PythonVersionInfo(3, 6))
|
||||||
assert dirs == transform({'stdlib/2and3', 'stdlib/3',
|
assert dirs == transform({'stdlib/2and3', 'stdlib/3',
|
||||||
'stdlib/3.6', 'third_party/2and3',
|
'stdlib/3.6', 'third_party/2and3',
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
from os.path import dirname
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from test.helpers import get_example_dir, example_dir
|
from test.helpers import get_example_dir, example_dir
|
||||||
from jedi import Project
|
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):
|
def test_implicit_namespace_package(Script):
|
||||||
sys_path = [get_example_dir('implicit_namespace_package', 'ns1'),
|
sys_path = [get_example_dir('implicit_namespace_package', 'ns1'),
|
||||||
get_example_dir('implicit_namespace_package', 'ns2')]
|
get_example_dir('implicit_namespace_package', 'ns2')]
|
||||||
|
|||||||
@@ -80,9 +80,6 @@ def test_relative_import(Script, environment, tmpdir):
|
|||||||
"""
|
"""
|
||||||
Attempt a relative import in a very simple namespace package.
|
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')
|
directory = get_example_dir('namespace_package_relative_import')
|
||||||
# Need to copy the content in a directory where there's no __init__.py.
|
# Need to copy the content in a directory where there's no __init__.py.
|
||||||
py.path.local(directory).copy(tmpdir)
|
py.path.local(directory).copy(tmpdir)
|
||||||
|
|||||||
@@ -11,21 +11,21 @@ from ..helpers import get_example_dir
|
|||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
'code, sig, names, op, version', [
|
'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)),
|
('pow', 'pow(base, exp, mod=None)', ['base', 'exp', 'mod'], ge, (3, 8)),
|
||||||
|
|
||||||
('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)',
|
('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)',
|
||||||
['self', 'sep'], lt, (3, 5)),
|
['self', 'sep'], lt, (3, 6)),
|
||||||
('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 5)),
|
('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, /) -> (head, sep, tail)', ['sep'], lt, (3, 6)),
|
||||||
('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 5)),
|
('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 6)),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
def test_compiled_signature(Script, environment, code, sig, names, op, version):
|
def test_compiled_signature(Script, environment, code, sig, names, op, version):
|
||||||
|
|||||||
Reference in New Issue
Block a user