methodParameters

lsst.utils.tests.methodParameters(**settings) → Callable

Iterate over supplied settings to create subtests automatically.

This decorator iterates over the supplied settings, using TestCase.subTest to communicate the values in the event of a failure.

Parameters:
**settings : dict (str: iterable)

The lists of test parameters. Each should be an iterable of the same length.

Examples

@methodParameters(foo=[1, 2], bar=[3, 4])
def testSomething(self, foo, bar):
    ...

will run:

testSomething(foo=1, bar=3)
testSomething(foo=2, bar=4)