February 2022
Intermediate to advanced
274 pages
6h 28m
English
In the last couple of chapters, we looked at custom and builtin fixtures. In this chapter, we return to test functions. We’ll look at how to turn one test function into many test cases to test more thoroughly with less work. We’ll do this with parametrization.
Parametrized testing refers to adding parameters to our test functions and passing in multiple sets of arguments to the test to create new test cases. We’ll look at three ways to implement parametrized testing in pytest in the order in which they should be selected:
We’ll compare them side by side by solving the same parametrization problem using all three methods; however, ...
Read now
Unlock full access