def test_greedy_completions():
ip = get_ipython()
ip.ex('a=list(range(5))')
_,c = ip.complete('.',line='a[0].')
nt.assert_false('.real' in c,
"Shouldn't have completed on a[0]: %s"%c)
with greedy_completion():
def _(line, cursor_pos, expect, message):
_,c = ip.complete('.', line=line, cursor_pos=cursor_pos)
nt.assert_in(expect, c, message%c)
yield _, 'a[0].', 5, 'a[0].real', "Should have completed on a[0].: %s"
yield _, 'a[0].r', 6, 'a[0].real', "Should have completed on a[0].r: %s"
if sys.version_info > (3,4):
yield _, 'a[0].from_', 10, 'a[0].from_bytes', "Should have completed on a[0].from_: %s"
评论列表
文章目录