def requires_ext(**kwargs):
 def decorator(func):
  @functools.wraps(func)
  def wrapper(*func_args, **func_kwargs):
   if (not is_extension_enabled(kwargs['extension'], kwargs['service'])):
    msg = ('Skipped because %s extension: %s is not enabled' % (kwargs['service'], kwargs['extension']))
    raise testtools.TestCase.skipException(msg)
   return func(*func_args, **func_kwargs)
  return wrapper
 return decorator

def requires_ext ( ** kwargs ) : def decorator ( func ) : @ functools . wraps ( func ) def wrapper ( * func_args , ** func_kwargs ) : if ( not is_extension_enabled ( kwargs [ 'extension' ] , kwargs [ 'service' ] ) ) : msg = ( 'Skipped because %s extension: %s is not enabled' % ( kwargs [ 'service' ] , kwargs [ 'extension' ] ) ) raise testtools . TestCase . skipException ( msg ) return func ( * func_args , ** func_kwargs ) return wrapper return decorator
a decorator to skip tests if an extension is not enabled .