forked from VimPlug/jedi
Drop support for EOL Python 2.6
This commit is contained in:
@@ -13,7 +13,6 @@ from jedi._compatibility import find_module_py33, find_module
|
||||
from ..helpers import cwd_at
|
||||
|
||||
from jedi import Script
|
||||
from jedi._compatibility import is_py26
|
||||
|
||||
|
||||
@pytest.mark.skipif('sys.version_info < (3,3)')
|
||||
@@ -47,7 +46,6 @@ def test_find_module_package_zipped():
|
||||
assert len(jedi.Script('import pkg; pkg.mod', 1, 19).completions()) == 1
|
||||
|
||||
|
||||
@pytest.mark.skipif('sys.version_info < (2,7)')
|
||||
def test_find_module_not_package_zipped():
|
||||
if 'zipped_imports/not_pkg.zip' not in sys.path:
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__),
|
||||
@@ -160,8 +158,7 @@ def test_complete_on_empty_import():
|
||||
|
||||
wanted = set(['ImportError', 'import', 'ImportWarning'])
|
||||
assert set([c.name for c in Script("import").completions()]) == wanted
|
||||
if not is_py26: # python 2.6 doesn't always come with a library `import*`.
|
||||
assert len(Script("import import", path='').completions()) > 0
|
||||
assert len(Script("import import", path='').completions()) > 0
|
||||
|
||||
# 111
|
||||
assert Script("from datetime import").completions()[0].name == 'import'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
import jedi
|
||||
from jedi._compatibility import py_version, unicode
|
||||
from jedi._compatibility import py_version
|
||||
|
||||
|
||||
def _eval_literal(code):
|
||||
|
||||
@@ -45,20 +45,5 @@ def generate_pyc():
|
||||
shutil.copy(os.path.join("dummy_package/__pycache__", f), dst)
|
||||
|
||||
|
||||
# Python 2.6 does not necessarily come with `compileall.compile_file`.
|
||||
@pytest.mark.skipif("sys.version_info > (2,6)")
|
||||
@cwd_at('test/test_evaluate')
|
||||
def test_pyc():
|
||||
"""
|
||||
The list of completion must be greater than 2.
|
||||
"""
|
||||
try:
|
||||
generate_pyc()
|
||||
s = jedi.Script("from dummy_package import dummy; dummy.", path='blub.py')
|
||||
assert len(s.completions()) >= 2
|
||||
finally:
|
||||
shutil.rmtree("dummy_package")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_pyc()
|
||||
|
||||
@@ -6,7 +6,6 @@ from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
from jedi import Script
|
||||
from jedi._compatibility import is_py26
|
||||
|
||||
# The namedtuple is different for different Python2.7 versions. Some versions
|
||||
# are missing the attribute `_class_template`.
|
||||
@@ -25,10 +24,7 @@ def test_namedtuple_str(letter, expected):
|
||||
dave.%s""") % letter
|
||||
result = Script(source).completions()
|
||||
completions = set(r.name for r in result)
|
||||
if is_py26:
|
||||
assert completions == set()
|
||||
else:
|
||||
assert completions == set(expected)
|
||||
assert completions == set(expected)
|
||||
|
||||
|
||||
def test_namedtuple_list():
|
||||
@@ -39,10 +35,7 @@ def test_namedtuple_list():
|
||||
garfield.l""")
|
||||
result = Script(source).completions()
|
||||
completions = set(r.name for r in result)
|
||||
if is_py26:
|
||||
assert completions == set()
|
||||
else:
|
||||
assert completions == set(['legs', 'length', 'large'])
|
||||
assert completions == set(['legs', 'length', 'large'])
|
||||
|
||||
|
||||
def test_namedtuple_content():
|
||||
|
||||
Reference in New Issue
Block a user