Skip to content
RED SAG Skills
medium10 pts · first answer countstest-automationpytestfixtures

Clean-up in a pytest fixture

What happens to the code after yield in this fixture if the test fails?

@pytest.fixture
def temp_customer(api):
    customer = api.create_customer(name="Test Co")
    yield customer
    api.delete_customer(customer.id)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions