In the previous chapter, we saw how pytest can be used to run our test suites, and how it provides some more advanced features that are unavailable in unittest by default. Python has seen multiple frameworks and libraries built on top of unittest to extend it with various features and utilities, but pytest has surely become the most widespread testing framework in the Python community. One of the reasons why pytest became so popular is its flexibility and support for dynamic behaviors. Apart from this, generating tests and fixtures dynamically or heavily changing test suite behavior are other features supported by pytest out of the box.
In this chapter, we are going to see how to configure a test suite and generate dynamic fixtures and dynamic or parametric tests. As your test suite grows, it will be important to be able to know which...