1
0
forked from VimPlug/jedi

Some refactoring to finally get tests working with py27 and 3 environments

This commit is contained in:
Dave Halter
2017-12-30 05:01:50 +01:00
parent b716fb7dc6
commit b901ab9b0d
3 changed files with 7 additions and 7 deletions

View File

@@ -30,9 +30,9 @@ def cwd_at(path):
"""
def decorator(func):
@functools.wraps(func)
def wrapper(Script, **kwds):
def wrapper(Script, **kwargs):
with set_cwd(path):
return func(Script, **kwds)
return func(Script, **kwargs)
return wrapper
return decorator

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(**kwargs):
def wrapper(Script, **kwargs):
if run_warm:
func(**kwargs)
func(Script=Script, **kwargs)
first = time.time()
for i in range(number):
func(**kwargs)
func(Script=Script, **kwargs)
single_time = (time.time() - first) / number
message = 'speed issue %s, %s' % (func, single_time)
assert single_time < time_per_run, message
@@ -57,7 +57,7 @@ def test_precedence_slowdown(Script):
@_check_speed(0.1)
def test_no_repr_computation():
def test_no_repr_computation(Script):
"""
For Interpreter completion aquisition of sourcefile can trigger
unwanted computation of repr(). Exemple : big pandas data.

View File

@@ -79,7 +79,7 @@ class TestSetupReadline(unittest.TestCase):
assert len(set(self.completions(s)).symmetric_difference(goal)) < 20
@cwd_at('test')
def test_local_import(self, _):
def test_local_import(self):
s = 'import test_utils'
assert self.completions(s) == [s]