test_manager.py 文件源码

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

项目:dsq 作者: baverman 项目源码 文件源码
def test_sync_manager(manager):
    manager.sync = True

    @manager.task
    def foo(a, b):
        foo.called = True
        return a + b

    assert foo.push(1, 2).ready().value == 3
    assert foo.called

    with pytest.raises(KeyError):
        manager.process(make_task('boo'))

    @manager.task
    def bad():
        raise ZeroDivisionError()

    with pytest.raises(ZeroDivisionError):
        bad.push()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号