1
0
forked from VimPlug/jedi

Make sure to not load unsafe modules anymore if they are not on the sys path, fixes #760

This commit is contained in:
Dave Halter
2020-01-31 13:09:28 +01:00
parent e7a77e438d
commit 8ff2ea4b38
6 changed files with 56 additions and 23 deletions

View File

@@ -55,7 +55,8 @@ def pyc_project_path(tmpdir):
shutil.rmtree(path)
def test_pyc(pyc_project_path, environment):
@pytest.mark.parametrize('load_unsafe_extensions', [False, True])
def test_pyc(pyc_project_path, environment, load_unsafe_extensions):
"""
The list of completion must be greater than 2.
"""
@@ -66,8 +67,14 @@ def test_pyc(pyc_project_path, environment):
# we also have the same version and it's easier to debug.
environment = SameEnvironment()
environment = environment
project = jedi.Project(pyc_project_path, load_unsafe_extensions=load_unsafe_extensions)
s = jedi.Script(
"from dummy_package import dummy; dummy.",
path=path,
environment=environment)
assert len(s.complete()) >= 2
environment=environment,
project=project,
)
if load_unsafe_extensions:
assert len(s.complete()) >= 2
else:
assert not s.complete()