mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-09 05:22:19 +08:00
Move the module name searching to the subprocess
This commit is contained in:
@@ -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() == []
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user