'Decorate a class or function'

def __call__(self, func_or_class):

    if inspect.isclass(func_or_class):
        for attr in func_or_class.__dict__.keys():
            prop = getattr(func_or_class, attr)
            if (attr.startswith('test') and callable(prop)):
                setattr(func_or_class, attr, self.decorate(prop))
        return func_or_class
    else:
        return self.decorate(func_or_class)
