Pytest's parametrize decorator is awesome! Even better is to use your own functions to populate the data:

https://nedbatchelder.com/blog/202602/pytest_parameter_functions

Pytest parameter functions

Pytest’s parametrize can be made even more powerful with your own helper functions to build test cases.

@nedbat I didn't click on this link thinking I'd read the Gettysburg address in full, without the newlines rendered, yet here I am