conftest.py 文件源码

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

项目:new-awesome 作者: starcraftman 项目源码 文件源码
def mock_input():
    """
    A fixture that mocks python's print function during test.
    """
    if sys.version_info < (3, 0):
        input_mod = '__builtin__.raw_input'
    else:
        input_mod = 'builtins.input'
    with mock.patch(input_mod) as mock_obj:
        yield mock_obj


# @pytest.yield_fixture(scope='function', autouse=True)
# def around_all_tests():
    # """
    # Executes before and after EVERY test.

    # Can be helpful for tracking bugs impacting test bed.
    # """
    # # before
    # yield
    # # after
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号