Ejemplo n.º 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
Ejemplo n.º 6
0
def accum4(scope="session"):
    return Accumulator()
Ejemplo n.º 7
0
def accum3():
    yield Accumulator()
    print("DONE-ZO!")
Ejemplo n.º 8
0
def accum():
    return Accumulator()  # a fixture should always return a value
Ejemplo n.º 9
0
def accum():
    yield Accumulator()
    print("DONE...! wow")
Ejemplo n.º 10
0
def accum():
    return Accumulator()  # return/yield, yield turns it to a generator