From 7e295d05a169786f41dd2200bfd427bde193d7f2 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 2 Jul 2020 00:24:51 +0200 Subject: [PATCH] Remove some more Python 2/3.5 references --- test/completion/stubs.py | 1 + test/test_api/test_completion.py | 3 --- test/test_api/test_interpreter.py | 2 -- test/test_inference/test_gradual/test_stubs.py | 5 ----- .../test_inference/test_gradual/test_typeshed.py | 7 ------- .../test_implicit_namespace_package.py | 10 ---------- test/test_inference/test_namespace_package.py | 3 --- test/test_inference/test_signature.py | 16 ++++++++-------- 8 files changed, 9 insertions(+), 38 deletions(-) diff --git a/test/completion/stubs.py b/test/completion/stubs.py index a99549b0..da952372 100644 --- a/test/completion/stubs.py +++ b/test/completion/stubs.py @@ -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 # ------------------------- diff --git a/test/test_api/test_completion.py b/test/test_api/test_completion.py index eda88fe2..354bd43b 100644 --- a/test/test_api/test_completion.py +++ b/test/test_api/test_completion.py @@ -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(): diff --git a/test/test_api/test_interpreter.py b/test/test_api/test_interpreter.py index bae881de..54195717 100644 --- a/test/test_api/test_interpreter.py +++ b/test/test_api/test_interpreter.py @@ -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. diff --git a/test/test_inference/test_gradual/test_stubs.py b/test/test_inference/test_gradual/test_stubs.py index 6683474a..71a881d9 100644 --- a/test/test_inference/test_gradual/test_stubs.py +++ b/test/test_inference/test_gradual/test_stubs.py @@ -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. diff --git a/test/test_inference/test_gradual/test_typeshed.py b/test/test_inference/test_gradual/test_typeshed.py index 157128c6..73c9d194 100644 --- a/test/test_inference/test_gradual/test_typeshed.py +++ b/test/test_inference/test_gradual/test_typeshed.py @@ -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', diff --git a/test/test_inference/test_implicit_namespace_package.py b/test/test_inference/test_implicit_namespace_package.py index 452375b3..5b242b66 100644 --- a/test/test_inference/test_implicit_namespace_package.py +++ b/test/test_inference/test_implicit_namespace_package.py @@ -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')] diff --git a/test/test_inference/test_namespace_package.py b/test/test_inference/test_namespace_package.py index 67fa49b6..8bde5770 100644 --- a/test/test_inference/test_namespace_package.py +++ b/test/test_inference/test_namespace_package.py @@ -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) diff --git a/test/test_inference/test_signature.py b/test/test_inference/test_signature.py index eb723725..500759bc 100644 --- a/test/test_inference/test_signature.py +++ b/test/test_inference/test_signature.py @@ -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):