def test_no_change_prompt(self):
if platform.python_implementation() == 'PyPy':
raise unittest.SkipTest("This test fails on PyPy because of REPL differences")
child = pexpect.spawnu('python', echo=False, timeout=5)
# prompt_change=None should mean no prompt change
py = replwrap.REPLWrapper(child, replwrap.u(">>> "), prompt_change=None,
continuation_prompt=replwrap.u("... "))
assert py.prompt == ">>> "
res = py.run_command("for a in range(3): print(a)\n")
assert res.strip().splitlines() == ['0', '1', '2']
评论列表
文章目录