forked from VimPlug/jedi
Try to read bytes if possible, not unicode
This commit is contained in:
@@ -7,7 +7,8 @@ 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, get_cached_default_environment
|
||||
get_system_environment, create_environment, InterpreterEnvironment, \
|
||||
get_cached_default_environment
|
||||
|
||||
|
||||
def test_sys_path():
|
||||
@@ -71,7 +72,9 @@ def test_stdout_in_subprocess(evaluator, Script):
|
||||
Script('1').goto_definitions()
|
||||
|
||||
|
||||
def test_killed_subprocess(evaluator, Script):
|
||||
def test_killed_subprocess(evaluator, Script, environment):
|
||||
if isinstance(environment, InterpreterEnvironment):
|
||||
pytest.skip("We cannot kill our own process")
|
||||
# Just kill the subprocess.
|
||||
evaluator.compiled_subprocess._compiled_subprocess._process.kill()
|
||||
# Since the process was terminated (and nobody knows about it) the first
|
||||
|
||||
@@ -13,7 +13,7 @@ import sys
|
||||
import pytest
|
||||
|
||||
import jedi
|
||||
from jedi.api.environment import SameEnvironment
|
||||
from jedi.api.environment import SameEnvironment, InterpreterEnvironment
|
||||
|
||||
|
||||
SRC = """class Foo:
|
||||
@@ -55,13 +55,19 @@ def pyc_project_path(tmpdir):
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def test_pyc(pyc_project_path):
|
||||
def test_pyc(pyc_project_path, environment):
|
||||
"""
|
||||
The list of completion must be greater than 2.
|
||||
"""
|
||||
path = os.path.join(pyc_project_path, 'blub.py')
|
||||
if not isinstance(environment, InterpreterEnvironment):
|
||||
# We are using the same version for pyc completions here, because it
|
||||
# was compiled in that version. However with interpreter environments
|
||||
# we also have the same version and it's easier to debug.
|
||||
environment = SameEnvironment()
|
||||
environment = environment
|
||||
s = jedi.Script(
|
||||
"from dummy_package import dummy; dummy.",
|
||||
path=path,
|
||||
environment=SameEnvironment())
|
||||
environment=environment)
|
||||
assert len(s.completions()) >= 2
|
||||
|
||||
Reference in New Issue
Block a user