##// END OF EJS Templates
Prepare some test for pytest in completers....
Matthias Bussonnier -
Show More
@@ -387,8 +387,8 b' def test_greedy_completions():'
387 _,c = ip.complete('.',line='a[0].')
387 _,c = ip.complete('.',line='a[0].')
388 nt.assert_false('.real' in c,
388 nt.assert_false('.real' in c,
389 "Shouldn't have completed on a[0]: %s"%c)
389 "Shouldn't have completed on a[0]: %s"%c)
390 with greedy_completion(), provisionalcompleter():
390 def _(line, cursor_pos, expect, message, completion):
391 def _(line, cursor_pos, expect, message, completion):
391 with greedy_completion(), provisionalcompleter():
392 ip.Completer.use_jedi = False
392 ip.Completer.use_jedi = False
393 _,c = ip.complete('.', line=line, cursor_pos=cursor_pos)
393 _,c = ip.complete('.', line=line, cursor_pos=cursor_pos)
394 nt.assert_in(expect, c, message % c)
394 nt.assert_in(expect, c, message % c)
@@ -398,6 +398,7 b' def test_greedy_completions():'
398 completions = ip.Completer.completions(line, cursor_pos)
398 completions = ip.Completer.completions(line, cursor_pos)
399 nt.assert_in(completion, completions)
399 nt.assert_in(completion, completions)
400
400
401 with provisionalcompleter():
401 yield _, 'a[0].', 5, 'a[0].real', "Should have completed on a[0].: %s", Completion(5,5, 'real')
402 yield _, 'a[0].', 5, 'a[0].real', "Should have completed on a[0].: %s", Completion(5,5, 'real')
402 yield _, 'a[0].r', 6, 'a[0].real', "Should have completed on a[0].r: %s", Completion(5,6, 'real')
403 yield _, 'a[0].r', 6, 'a[0].real', "Should have completed on a[0].r: %s", Completion(5,6, 'real')
403
404
General Comments 0
You need to be logged in to leave comments. Login now