Move the module name searching to the subprocess

This commit is contained in:
Dave Halter
2017-12-29 21:04:56 +01:00
parent 68381e09c9
commit 7de04fb28d
4 changed files with 24 additions and 13 deletions

View File

@@ -1,7 +1,6 @@
"""
Test of keywords and ``jedi.keywords``
"""
from jedi._compatibility import is_py3
def test_goto_assignments_keyword(Script):
@@ -13,13 +12,13 @@ def test_goto_assignments_keyword(Script):
Script('in').goto_assignments()
def test_keyword(Script):
def test_keyword(Script, environment):
""" github jedi-vim issue #44 """
defs = Script("print").goto_definitions()
if is_py3:
assert [d.docstring() for d in defs]
else:
if environment.version_info.major < 3:
assert defs == []
else:
assert [d.docstring() for d in defs]
assert Script("import").goto_assignments() == []

View File

@@ -17,12 +17,12 @@ def _check_speed(time_per_run, number=4, run_warm=True):
reintroduced to Jedi."""
def decorated(func):
@functools.wraps(func)
def wrapper():
def wrapper(**kwargs):
if run_warm:
func()
func(**kwargs)
first = time.time()
for i in range(number):
func()
func(**kwargs)
single_time = (time.time() - first) / number
message = 'speed issue %s, %s' % (func, single_time)
assert single_time < time_per_run, message