In this chapter, we saw why pytest is considered a very flexible and powerful framework for writing test suites. Its capabilities to automatically generate tests and fixtures on the fly and to change their behaviors through hooks and plugins are very helpful, allowing us to write smaller test suites that cover more cases.
The problem with those techniques is that they make it less clear what's being tested and how, so it's always a bad idea to abuse them. It's usually better to ensure that your test is easy to read and clear about what's going on. That way, it can act as a form of documentation on the behavior of the software and allow other team members to learn about a new feature by reading its test suite.
Only once all our test suites are written in a simple and easy-to-understand way can we focus on reducing the complexity of those suites by virtue of parameterization or dynamically generated behaviors. When dynamically generated behaviors get in the way...