def test_supplier_resets(): blah_supplier = Supplier("blah") with blah_supplier.use("hello"): pass with pytest.raises(Exception): blah_supplier.get()
def test_supplier_can_be_used_multiple_times(): foo_supplier = Supplier("foo") with foo_supplier.use("hello"): assert foo_supplier.get() == "hello" with foo_supplier.use("hi"): assert foo_supplier.get() == "hi"
def test_supplier_supplies(): blah_supplier = Supplier("blah") with blah_supplier.use("hello"): assert blah_supplier.get() == "hello"