def DoesTestHaveLabels(cls, labels):
 labels = set(labels)
 for name in dir(cls):
  if name.startswith('test'):
   item = getattr(cls, name, None)
   if labels.intersection(getattr(item, 'labels', set(['small']))):
    return True
 return False

def DoesTestHaveLabels ( cls , labels ) : labels = set ( labels ) for name in dir ( cls ) : if name . startswith ( 'test' ) : item = getattr ( cls , name , None ) if labels . intersection ( getattr ( item , 'labels' , set ( [ 'small' ] ) ) ) : return True return False
returns true if any tests in cls have any of the labels .