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