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()
评论列表
文章目录