예제 #1
0
def test_yield_values_raises_error():
    error = ValueError("whoops")

    def ex():
        raise error

    assert list(yield_values(ex)) == [Value(error)]
예제 #2
0
def test_yield_values():
    def ex():
        yield 1

    assert list(yield_values(ex)) == [Value(1)]
예제 #3
0
def test_yield_values_empty():
    def ex():
        if False:
            yield None

    assert list(yield_values(ex)) == []
예제 #4
0
def test_yield_values():
    def ex():
        yield 1
    assert list(yield_values(ex)) == [Value(1)]
예제 #5
0
def test_yield_values_empty():
    def ex():
        if False:
            yield None
    assert list(yield_values(ex)) == []
예제 #6
0
def test_yield_values_raises_error():
    error = ValueError("whoops")

    def ex():
        raise error
    assert list(yield_values(ex)) == [Value(error)]