def test_do_complete(kernel): """ Check do complete works in normal and debugging mode. """ kernel.do_execute('abba = 1', True) assert kernel.get_value('abba') == 1 match = kernel.do_complete('ab', 2) assert 'abba' in match['matches'] # test pdb pdb_obj = SpyderPdb() pdb_obj.curframe = inspect.currentframe() pdb_obj.completenames = lambda *ignore: ['baba'] kernel._pdb_obj = pdb_obj match = kernel.do_complete('ba', 2) assert 'baba' in match['matches']
def test_do_complete(kernel): """ Check do complete works in normal and debugging mode. """ if IPYKERNEL_6: asyncio.run(kernel.do_execute('abba = 1', True)) else: kernel.do_execute('abba = 1', True) assert kernel.get_value('abba') == 1 match = kernel.do_complete('ab', 2) assert 'abba' in match['matches'] # test pdb pdb_obj = SpyderPdb() pdb_obj.curframe = inspect.currentframe() pdb_obj.completenames = lambda *ignore: ['baba'] kernel.shell.pdb_session = pdb_obj match = kernel.do_complete('ba', 2) assert 'baba' in match['matches'] pdb_obj.curframe = None