예제 #1
0
def accum():
    return Accumulator()
def test_accumulator_add_twice():
    accum = Accumulator()
    accum.add()
    accum.add()
    assert accum.count == 2
def test_accumulator_cannot_set_count_directly():
    accum = Accumulator()
    with pytest.raises(AttributeError, match=r"can't set attribute") as e:
        accum.count = 10
def test_accumulator_init():
    accum = Accumulator()
    assert accum.count == 0
def test_accumulator_add_three():
    accum = Accumulator()
    accum.add(3)
    assert accum.count == 3
예제 #6
0
def accum4(scope="session"):
    return Accumulator()
예제 #7
0
def accum3():
    yield Accumulator()
    print("DONE-ZO!")
예제 #8
0
def accum():
    return Accumulator()  # a fixture should always return a value
예제 #9
0
def accum():
    yield Accumulator()
    print("DONE...! wow")
예제 #10
0
def accum():
    return Accumulator()  # return/yield, yield turns it to a generator