mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-09 21:42:20 +08:00
Remove a lot of sys.version_info references
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from textwrap import dedent
|
||||
import math
|
||||
import sys
|
||||
from collections import Counter
|
||||
from datetime import datetime
|
||||
|
||||
@@ -146,7 +145,6 @@ def test_parent_context(same_process_inference_state, attribute, expected_name,
|
||||
assert x.parent_context.parent_context is None
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL")
|
||||
@pytest.mark.parametrize(
|
||||
'obj, expected_names', [
|
||||
('', ['str']),
|
||||
|
||||
@@ -3,7 +3,6 @@ Testing of docstring related issues and especially ``jedi.docstrings``.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
@@ -25,11 +24,6 @@ except ImportError:
|
||||
else:
|
||||
numpy_unavailable = False
|
||||
|
||||
if sys.version_info.major == 2:
|
||||
# In Python 2 there's an issue with tox/docutils that makes the tests fail,
|
||||
# Python 2 is soon end-of-life, so just don't support numpydoc for it anymore.
|
||||
numpydoc_unavailable = True
|
||||
|
||||
|
||||
def test_function_doc(Script):
|
||||
defs = Script("""
|
||||
|
||||
@@ -19,8 +19,7 @@ from ..helpers import get_example_dir, test_dir, test_dir_project, root_dir
|
||||
THIS_DIR = os.path.dirname(__file__)
|
||||
|
||||
|
||||
@pytest.mark.skipif('sys.version_info < (3,3)')
|
||||
def test_find_module_py33():
|
||||
def test_find_module_basic():
|
||||
"""Needs to work like the old find_module."""
|
||||
assert find_module_py33('_io') == (None, False)
|
||||
with pytest.raises(ImportError):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import Generic, TypeVar, List
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -86,7 +85,6 @@ def test_mixed_module_cache():
|
||||
assert isinstance(jedi_module, ModuleValue)
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, EoL")
|
||||
def test_signature():
|
||||
"""
|
||||
For performance reasons we use the signature of the compiled object and not
|
||||
|
||||
@@ -39,16 +39,14 @@ def pyc_project_path(tmpdir):
|
||||
compileall.compile_file(dummy_path)
|
||||
os.remove(dummy_path)
|
||||
|
||||
if sys.version_info.major == 3:
|
||||
# Python3 specific:
|
||||
# To import pyc modules, we must move them out of the __pycache__
|
||||
# directory and rename them to remove ".cpython-%s%d"
|
||||
# see: http://stackoverflow.com/questions/11648440/python-does-not-detect-pyc-files
|
||||
pycache = os.path.join(dummy_package_path, "__pycache__")
|
||||
for f in os.listdir(pycache):
|
||||
dst = f.replace('.cpython-%s%s' % sys.version_info[:2], "")
|
||||
dst = os.path.join(dummy_package_path, dst)
|
||||
shutil.copy(os.path.join(pycache, f), dst)
|
||||
# To import pyc modules, we must move them out of the __pycache__
|
||||
# directory and rename them to remove ".cpython-%s%d"
|
||||
# see: http://stackoverflow.com/questions/11648440/python-does-not-detect-pyc-files
|
||||
pycache = os.path.join(dummy_package_path, "__pycache__")
|
||||
for f in os.listdir(pycache):
|
||||
dst = f.replace('.cpython-%s%s' % sys.version_info[:2], "")
|
||||
dst = os.path.join(dummy_package_path, dst)
|
||||
shutil.copy(os.path.join(pycache, f), dst)
|
||||
try:
|
||||
yield path
|
||||
finally:
|
||||
@@ -56,7 +54,6 @@ def pyc_project_path(tmpdir):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('load_unsafe_extensions', [False, True])
|
||||
@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL")
|
||||
def test_pyc(pyc_project_path, environment, load_unsafe_extensions):
|
||||
"""
|
||||
The list of completion must be greater than 2.
|
||||
|
||||
Reference in New Issue
Block a user