O'Reilly logo
  • Chris Kang thinks this is interesting:

These fixtures all include two fixtures each in their parameter list: tasks_db and a data set. The data set is used to add tasks to the database. Now tests can use these when you want the test to start from a non-empty database, like this:


Cover of Python Testing with pytest


Both of these fixtures utilize other fixtures to satisfy its dependencies. You can chain these fixtures to have specialized fixtures that can be shared between other fixtures.