mock_.py 文件源码

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

项目:asynq 作者: quora 项目源码 文件源码
def patch(
        target, new=mock.DEFAULT, spec=None, create=False,
        mocksignature=False, spec_set=None, autospec=False,
        new_callable=None, **kwargs
):
    """Mocks an async function.

    Should be a drop-in replacement for mock.patch that handles async automatically. The .asynq
    attribute is automatically created and shouldn't be used when accessing data on
    the mock.

    """
    getter, attribute = _get_target(target)
    return _make_patch_async(
        getter, attribute, new, spec, create, mocksignature, spec_set, autospec, new_callable,
        kwargs
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号