From 144a1def6cd2f15c6e865c64d006a05c2d51179f Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 13 Mar 2018 22:59:07 +0100 Subject: [PATCH] Fix a few version issues in tests --- test/test_api/test_interpreter.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/test_api/test_interpreter.py b/test/test_api/test_interpreter.py index 7534dcd7..0dfbd1ac 100644 --- a/test/test_api/test_interpreter.py +++ b/test/test_api/test_interpreter.py @@ -227,7 +227,7 @@ def test_param_completion(): lambd = lambda xyz: 3 _assert_interpreter_complete('foo(bar', locals(), ['bar']) - assert bool(jedi.Interpreter('lambd(xyz', [locals()]).completions()) == is_py35 + assert bool(jedi.Interpreter('lambd(xyz', [locals()]).completions()) == is_py3 def test_endless_yield(): @@ -271,10 +271,12 @@ def test_keyword_argument(): assert c.name == 'some_keyword_argument' assert c.complete == 'ord_argument=' - # Make it impossible for jedi to find the source of the function. - f.__name__ = 'xSOMETHING' - c, = jedi.Interpreter("x(some_keyw", [{'x': f}]).completions() - assert c.name == 'some_keyword_argument' + # This needs inspect.signature to work. + if is_py3: + # Make it impossible for jedi to find the source of the function. + f.__name__ = 'xSOMETHING' + c, = jedi.Interpreter("x(some_keyw", [{'x': f}]).completions() + assert c.name == 'some_keyword_argument' def test_more_complex_instances():