September 2017
Intermediate to advanced
222 pages
5h 1m
English
You’ve already seen that tmpdir uses tmpdir_factory. And you used tmpdir in our tasks_db fixture. Let’s keep the chain going and add some specialized fixtures for non-empty tasks databases:
| | @pytest.fixture() |
| | def db_with_3_tasks(tasks_db, tasks_just_a_few): |
| | """Connected db with 3 tasks, all unique.""" |
| | for t in tasks_just_a_few: |
| | tasks.add(t) |
| | |
| | |
| | @pytest.fixture() |
| | def db_with_multi_per_owner(tasks_db, tasks_mult_per_owner): |
| | """Connected db with 9 tasks, 3 owners, all with 3 tasks.""" |
| | for t in tasks_mult_per_owner: |
| | tasks.add(t) |
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 ...
Read now
Unlock full access