'Filter the test methods according to the labels they have.'

def getTestCaseNames(self, testCaseClass):

    result = []
    for test_name in super(GRRTestLoader, self).getTestCaseNames(testCaseClass):
        test_method = getattr(testCaseClass, test_name)
        test_labels = getattr(test_method, 'labels', set(['small']))
        if (self.labels and (not self.labels.intersection(test_labels))):
            continue
        result.append(test_name)
    return result
