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)Discussion 0
Join free to post in the discussion.
Related questions
- What a pytest fixture doesAutomation Test Engineer
- Arrange, Act, AssertAutomation Test Engineer
- An upside-down test pyramidAutomation Test Engineer
- Sharing fixtures in pytestAutomation Test Engineer
- Asserting that an error is raisedAutomation Test Engineer
- Running pytest in parallelAutomation Test Engineer
- A keyword-driven frameworkAutomation Test Engineer
- Layers in a test frameworkAutomation Test Engineer