This is useful for classes like the coming BuiltInConstantsTest class, where just one or two tests need to change the test class. --- framework/profile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/framework/profile.py b/framework/profile.py index d77ac09..b6deed0 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -205,7 +205,7 @@ class TestDict(collections.MutableMapping): """ assert isinstance(group, six.string_types), type(group) - def adder(args, name=None, **kwargs): + def adder(args, name=None, override_class=None, **kwargs): """Helper function that actually adds the tests. Arguments: @@ -228,7 +228,9 @@ class TestDict(collections.MutableMapping): assert isinstance(name, six.string_types) lgroup = grouptools.join(group, name) - self[lgroup] = test_class( + class_ = override_class or test_class + + self[lgroup] = class_( args, **dict(itertools.chain(six.iteritems(default_args), six.iteritems(kwargs)))) -- git-series 0.9.1 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit