mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-15 06:22:12 +08:00
Remove a lot of test references to Python 2/3.5
This commit is contained in:
@@ -163,7 +163,7 @@ def test_docstring_params_formatting(Script):
|
||||
assert defs[0].docstring() == 'func(param1, param2, param3)'
|
||||
|
||||
|
||||
def test_import_function_docstring(Script, skip_pre_python35):
|
||||
def test_import_function_docstring(Script):
|
||||
code = "from stub_folder import with_stub; with_stub.stub_function"
|
||||
path = os.path.join(test_dir, 'completion', 'import_function_docstring.py')
|
||||
c, = Script(code, path=path).complete()
|
||||
@@ -422,7 +422,7 @@ def test_decorator(Script):
|
||||
assert d.docstring(raw=True) == 'Nice docstring'
|
||||
|
||||
|
||||
def test_method_decorator(Script, skip_pre_python35):
|
||||
def test_method_decorator(Script):
|
||||
code = dedent('''
|
||||
def decorator(func):
|
||||
@wraps(func)
|
||||
@@ -443,7 +443,7 @@ def test_method_decorator(Script, skip_pre_python35):
|
||||
assert d.docstring() == 'wrapper(f)\n\nNice docstring'
|
||||
|
||||
|
||||
def test_partial(Script, skip_pre_python36):
|
||||
def test_partial(Script):
|
||||
code = dedent('''
|
||||
def foo():
|
||||
'x y z'
|
||||
|
||||
@@ -56,7 +56,7 @@ def test_goto_on_file(Script):
|
||||
assert d2.name == 'Bar'
|
||||
|
||||
|
||||
def test_goto_import(Script, skip_pre_python35):
|
||||
def test_goto_import(Script):
|
||||
code = 'from abc import ABC; ABC'
|
||||
d, = Script(code).goto(only_stubs=True)
|
||||
assert d.is_stub()
|
||||
|
||||
@@ -104,10 +104,11 @@ def test_signature():
|
||||
assert s.docstring() == 'some_signature(*, bar=1)'
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info[0:2] < (3, 5), reason="Typing was introduced in Python 3.5")
|
||||
def test_compiled_signature_annotation_string():
|
||||
import typing
|
||||
def func(x: typing.Type, y: typing.Union[typing.Type, int]): pass
|
||||
|
||||
def func(x: typing.Type, y: typing.Union[typing.Type, int]):
|
||||
pass
|
||||
func.__name__ = 'not_func'
|
||||
|
||||
s, = jedi.Interpreter('func()', [locals()]).get_signatures(1, 5)
|
||||
|
||||
@@ -175,7 +175,7 @@ def test_tree_signature(Script, environment, code, expected):
|
||||
('no_redirect(simple)', '*args, **kwargs'),
|
||||
]
|
||||
)
|
||||
def test_nested_signatures(Script, environment, combination, expected, skip_pre_python35):
|
||||
def test_nested_signatures(Script, environment, combination, expected):
|
||||
code = dedent('''
|
||||
def simple(a, b, *, c): ...
|
||||
def simple2(x): ...
|
||||
@@ -265,7 +265,7 @@ def test_pow_signature(Script):
|
||||
x(f)('''), 'f()'],
|
||||
]
|
||||
)
|
||||
def test_wraps_signature(Script, code, signature, skip_pre_python35):
|
||||
def test_wraps_signature(Script, code, signature):
|
||||
sigs = Script(code).get_signatures()
|
||||
assert {sig.to_string() for sig in sigs} == {signature}
|
||||
|
||||
@@ -315,7 +315,7 @@ def test_dataclass_signature(Script, skip_pre_python37, start, start_params):
|
||||
('kwargs = dict(b=3)', 'wrapped(b, /, **kwargs)'),
|
||||
]
|
||||
)
|
||||
def test_param_resolving_to_static(Script, stmt, expected, skip_pre_python35):
|
||||
def test_param_resolving_to_static(Script, stmt, expected):
|
||||
code = dedent('''\
|
||||
def full_redirect(func):
|
||||
def wrapped(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user