def x_server_test(f, cond, msg):
 if isinstance(f, (type, types.ClassType)):
  if (not cond):
   f.__unittest_skip__ = True
   f.__unittest_skip_why__ = msg
  return f
 else:
  @unittest.skipIf((not cond), msg)
  def wrapped_fn(*args, **kwargs):
   return f(*args, **kwargs)
  return wrapped_fn

def x_server_test ( f , cond , msg ) : if isinstance ( f , ( type , types . ClassType ) ) : if ( not cond ) : f . __unittest_skip__ = True f . __unittest_skip_why__ = msg return f else : @ unittest . skipIf ( ( not cond ) , msg ) def wrapped_fn ( * args , ** kwargs ) : return f ( * args , ** kwargs ) return wrapped_fn
decorator to label test classes or instance methods as x_only .