test_pdb.py 文件源码

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

项目:pdb 作者: antocuni 项目源码 文件源码
def test_help(command, expected_regex):
    from pdb import StringIO
    instance = PdbTest()
    instance.stdout = StringIO()

    # Redirect sys.stdout because Python 2 pdb.py has `print >>self.stdout` for
    # some functions and plain ol' `print` for others.
    try:
        sys.stdout = instance.stdout
        instance.do_help(command)
    finally:
        sys.stdout == sys.__stdout__

    output = instance.stdout.getvalue()
    assert re.search(expected_regex, output)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号