PHPUnit style dataProvider in Python unit test

PHPUnit has a handy feature with which you can provide testdata to your tests. This is called a data provider, and is implemented by annotating a test with @dataProvider methodName. Python’s unittest module doesn’t seem to have such a feature.

PHPUnit’s version

The data provider returns a two-dimensional array of test arguments. For example: