test_replwrap.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:obsoleted-vpduserv 作者: InfraSIM 项目源码 文件源码
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']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号