lsst.utils.tests.classParameters(**settings: Sequence[Any]) Callable

Class decorator for generating unit tests

This decorator generates classes with class variables according to the supplied settings.

**settingsdict (str: iterable)

The lists of test parameters to set as class variables in turn. Each should be an iterable of the same length.


@classParameters(foo=[1, 2], bar=[3, 4])
class MyTestCase(unittest.TestCase):

will generate two classes, as if you wrote:

class MyTestCase_1_3(unittest.TestCase):
    foo = 1
    bar = 3

class MyTestCase_2_4(unittest.TestCase):
    foo = 2
    bar = 4

Note that the values are embedded in the class name.