We have a large python project which is tested using pytest, currently with unittest style classes, and we started migrating it to module-based, function style tests.
We are having a debate whether we should:
- Split our large test base-class to many small, independent pytest fixtures; or
- Maintain a one large fixture which lazily imports all other fixtures.
Pros for many fixtures:
- Modular and probably easy to maintain
- Each test only uses what it needs
Pros for one large fixture:
- Less boilerplate code, each test only has one extra keyword arg
What should we do? Any opinions are welcome as long as they are explained. Thanks :)