def test_yield_values_raises_error(): error = ValueError("whoops") def ex(): raise error assert list(yield_values(ex)) == [Value(error)]
def test_yield_values(): def ex(): yield 1 assert list(yield_values(ex)) == [Value(1)]
def test_yield_values_empty(): def ex(): if False: yield None assert list(yield_values(ex)) == []