Remove py__version__

This commit is contained in:
Dave Halter
2020-07-02 02:28:47 +02:00
parent 0cd6a8f5cc
commit db28eee760
6 changed files with 8 additions and 26 deletions

View File

@@ -4,7 +4,6 @@ import sys
import pytest
import jedi
from jedi._compatibility import py_version
from jedi.api.environment import get_default_environment, find_virtualenvs, \
InvalidPythonEnvironment, find_system_environments, \
get_system_environment, create_environment, InterpreterEnvironment, \
@@ -33,7 +32,7 @@ def test_versions(version):
try:
env = get_system_environment(version)
except InvalidPythonEnvironment:
if int(version.replace('.', '')) == py_version:
if int(version.replace('.', '')) == str(sys.version_info[0]) + str(sys.version_info[1]):
# At least the current version has to work
raise
pytest.skip()

View File

@@ -3,26 +3,14 @@ Tests of ``jedi.api.Interpreter``.
"""
import sys
import warnings
import typing
import pytest
import jedi
from jedi._compatibility import py_version
from jedi.inference.compiled import mixed
from importlib import import_module
if py_version > 30:
def exec_(source, global_map):
exec(source, global_map)
else:
eval(compile("""def exec_(source, global_map):
exec source in global_map """, 'blub', 'exec'))
if py_version > 35:
import typing
else:
typing = None
class _GlobalNameSpace:
class SideEffectContainer:
@@ -321,7 +309,7 @@ def test_completion_param_annotations():
# Need to define this function not directly in Python. Otherwise Jedi is too
# clever and uses the Python code instead of the signature object.
code = 'def foo(a: 1, b: str, c: int = 1.0) -> bytes: pass'
exec_(code, locals())
exec(code, locals())
script = jedi.Interpreter('foo', [locals()])
c, = script.complete()
sig, = c.get_signatures()
@@ -625,7 +613,6 @@ def bar():
return float
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Ignore Python 2, because EOL")
@pytest.mark.parametrize(
'annotations, result, code', [
({}, [], ''),