def _bench_skipper(condition, skip_message):
 def decorator(func):
  if ((isinstance(condition, bool) and condition) or ((not isinstance(condition, bool)) and condition())):
   wrapper = unittest.skip('[{}] skipped: {}\n'.format(_get_bench_name(func), skip_message))(func)
  else:
   @wraps(func)
   def wrapper(*args, **kwargs):
    func(*args, **kwargs)
  return wrapper
 return decorator

def _bench_skipper ( condition , skip_message ) : def decorator ( func ) : if ( ( isinstance ( condition , bool ) and condition ) or ( ( not isinstance ( condition , bool ) ) and condition ( ) ) ) : wrapper = unittest . skip ( '[{}] skipped: {}\n' . format ( _get_bench_name ( func ) , skip_message ) ) ( func ) else : @ wraps ( func ) def wrapper ( * args , ** kwargs ) : func ( * args , ** kwargs ) return wrapper return decorator
a decorator factory for sipping benchmarks conditionally .