Ejemplo n.º 1
0
def phonebook():
    phonebook = Phonebook()
    yield phonebook
    phonebook.clear()
Ejemplo n.º 2
0
def phonebook_with_clear():
    """Provides an empty Phonebook"""
    phonebook = Phonebook()
    yield phonebook
    phonebook.clear()
Ejemplo n.º 3
0
def phonebook():
    'Provides an empty Phonebook'
    # the line above is fixture documentation. pytest --fixtures
    phonebook = Phonebook()
    yield phonebook
    phonebook.clear()  # anything following yield will be run as a test cleanup