Python·100 questions

How to work with fixtures in pytest?

Answer
@pytest.fixture for setup data.
scope=function/module/session.
Fixture can return an object or yield for teardown.
Fixtures can be parameterized.
Reduces test duplication.
Was this answer helpful?

More questions in this topic

Related questions from other topics