diff --git a/test/test_api/test_call_signatures.py b/test/test_api/test_call_signatures.py index 006b9510..ffafb4ea 100644 --- a/test/test_api/test_call_signatures.py +++ b/test/test_api/test_call_signatures.py @@ -5,7 +5,7 @@ import warnings from ..helpers import TestCase from jedi import Script from jedi import cache -from jedi._compatibility import is_py33 +from jedi._compatibility import is_py33, py_version def assert_signature(source, expected_name, expected_index=0, line=None, column=None): @@ -324,8 +324,10 @@ def test_keyword_argument_index(): def get(source, column=None): return Script(source, column=column).call_signatures()[0] - assert get('sorted([], key=a').index == 1 - assert get('sorted([], key=').index == 1 + # The signature of sorted changed from 2 to 3. + py2_offset = int(py_version < 30) + assert get('sorted([], key=a').index == 1 + py2_offset + assert get('sorted([], key=').index == 1 + py2_offset assert get('sorted([], no_key=a').index is None kw_func = 'def foo(a, b): pass\nfoo(b=3, a=4)' diff --git a/test/test_parso_integration/test_basic.py b/test/test_parso_integration/test_basic.py index f191f90e..8d47e85e 100644 --- a/test/test_parso_integration/test_basic.py +++ b/test/test_parso_integration/test_basic.py @@ -1,7 +1,10 @@ from textwrap import dedent +import pytest from parso import parse + import jedi +from jedi._compatibility import py_version def test_form_feed_characters(): @@ -86,7 +89,8 @@ def test_tokenizer_with_string_literal_backslash(): assert c[0]._name._context.get_safe_value() == 'foo' -def test_ellipsis(): +@pytest.mark.skipif('py_version < 30', reason='In 2.7 Ellipsis can only be used like x[...]') +def test_ellipsis_without_getitem(): def_, = jedi.Script('x=...;x').goto_definitions() assert def_.name == 'ellipsis'