Example #1
0
def test_athrow_sync():
    gen = Synchronizer()(athrow_example_gen)()
    v = gen.send(None)
    assert v == "hello"
    v = gen.throw(ZeroDivisionError)
    assert v == "world"
Example #2
0
def test_athrow_baseexc_sync():
    gen = Synchronizer()(athrow_example_gen)()
    v = gen.send(None)
    assert v == "hello"
    v = gen.throw(KeyboardInterrupt)
    assert v == "foobar"