mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Remove a lot of test references to Python 2/3.5
This commit is contained in:
@@ -595,7 +595,7 @@ def test_definition_goto_follow_imports(Script):
|
||||
'foo(x: str, y: int=None) -> Union[int, str]'),
|
||||
]
|
||||
)
|
||||
def test_get_type_hint(Script, code, expected, skip_pre_python36):
|
||||
def test_get_type_hint(Script, code, expected):
|
||||
code = 'from typing import *\n' + code
|
||||
d, = Script(code).goto()
|
||||
assert d.get_type_hint() == expected
|
||||
|
||||
@@ -382,7 +382,7 @@ _dict_keys_completion_tests = [
|
||||
@pytest.mark.parametrize(
|
||||
'added_code, column, expected', _dict_keys_completion_tests
|
||||
)
|
||||
def test_dict_keys_completions(Script, added_code, column, expected, skip_pre_python36):
|
||||
def test_dict_keys_completions(Script, added_code, column, expected):
|
||||
code = dedent(r'''
|
||||
ints = {1: ''}
|
||||
ints[50] = 3.0
|
||||
@@ -405,7 +405,7 @@ def test_dict_keys_completions(Script, added_code, column, expected, skip_pre_py
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL")
|
||||
def test_dict_keys_in_weird_case(Script, skip_pre_python36):
|
||||
def test_dict_keys_in_weird_case(Script):
|
||||
assert Script('a[\n# foo\nx]').complete(line=2, column=0)
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ def test_find_system_environments():
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'version',
|
||||
['2.7', '3.5', '3.6', '3.7']
|
||||
['3.6', '3.7', '3.8', '3.9']
|
||||
)
|
||||
def test_versions(version):
|
||||
try:
|
||||
|
||||
@@ -134,7 +134,7 @@ def test_load_save_project(tmpdir):
|
||||
]
|
||||
)
|
||||
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Ignore Python 2, because EOL")
|
||||
def test_search(string, full_names, kwargs, skip_pre_python36):
|
||||
def test_search(string, full_names, kwargs):
|
||||
some_search_test_var = 1.0
|
||||
project = Project(test_dir)
|
||||
if kwargs.pop('complete', False) is True:
|
||||
@@ -153,7 +153,7 @@ def test_search(string, full_names, kwargs, skip_pre_python36):
|
||||
]
|
||||
)
|
||||
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Ignore Python 2, because EOL")
|
||||
def test_complete_search(Script, string, completions, all_scopes, skip_pre_python36):
|
||||
def test_complete_search(Script, string, completions, all_scopes):
|
||||
project = Project(test_dir)
|
||||
defs = project.complete_search(string, all_scopes=all_scopes)
|
||||
assert [d.complete for d in defs] == completions
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
@@ -7,12 +6,6 @@ import pytest
|
||||
import jedi
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def skip_old_python(skip_pre_python36):
|
||||
if sys.version_info < (3, 6):
|
||||
pytest.skip()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def dir_with_content(tmpdir):
|
||||
with open(os.path.join(tmpdir.strpath, 'modx.py'), 'w', newline='') as f:
|
||||
|
||||
@@ -65,7 +65,7 @@ class SomeClass:
|
||||
('SomeCl.twice', [], dict(all_scopes=True, complete=True, fuzzy=True)),
|
||||
]
|
||||
)
|
||||
def test_simple_search(Script, string, descriptions, kwargs, skip_pre_python36):
|
||||
def test_simple_search(Script, string, descriptions, kwargs):
|
||||
if sys.version_info < (3, 6):
|
||||
pytest.skip()
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ def test_param_default(Script, code, expected_params):
|
||||
assert annotation.description == expected
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info < (3, 5), reason="Python <3.5 doesn't support __signature__")
|
||||
@pytest.mark.parametrize(
|
||||
'code, index, param_code, kind', [
|
||||
('def f(x=1): pass\nf', 0, 'x=1', 'POSITIONAL_OR_KEYWORD'),
|
||||
|
||||
Reference in New Issue
Block a user