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 a word of caution if I remember correctly: pytest will evaluate the arguments to parametrize during collection, which means those functions are called even if the tests themselves will end up being skipped.