def make_tag_decorator(known_tags):
 def tag(*tags):
  '\n        Tag a test method with the given tags.\n        Can be used in conjunction with the --tags command-line argument\n        for runtests.py.\n        '
  for t in tags:
   if (t not in known_tags):
    raise ValueError(('unknown tag: %r' % (t,)))
  def decorate(func):
   if ((not callable(func)) or isinstance(func, type) or (not func.__name__.startswith('test_'))):
    raise TypeError('@tag(...) should be used on test methods')
   try:
    s = func.tags
   except AttributeError:
    s = func.tags = set()
   s.update(tags)
   return func
  return decorate
 return tag

def make_tag_decorator ( known_tags ) : def tag ( * tags ) : for t in tags : if ( t not in known_tags ) : raise ValueError ( ( 'unknown tag: %r' % ( t , ) ) ) def decorate ( func ) : if ( ( not callable ( func ) ) or isinstance ( func , type ) or ( not func . __name__ . startswith ( 'test_' ) ) ) : raise TypeError ( '@tag(...) should be used on test methods' ) try : s = func . tags except AttributeError : s = func . tags = set ( ) s . update ( tags ) return func return decorate return tag
create a decorator allowing tests to be tagged with the *known_tags* .