def skip_if_disabled(func):
 @functools.wraps(func)
 def wrapped(*a, **kwargs):
  func.__test__ = False
  test_obj = a[0]
  message = getattr(test_obj, 'disabled_message', 'Test disabled')
  if getattr(test_obj, 'disabled', False):
   test_obj.skipTest(message)
  func(*a, **kwargs)
 return wrapped

def skip_if_disabled ( func ) : @ functools . wraps ( func ) def wrapped ( * a , ** kwargs ) : func . __test__ = False test_obj = a [ 0 ] message = getattr ( test_obj , 'disabled_message' , 'Test disabled' ) if getattr ( test_obj , 'disabled' , False ) : test_obj . skipTest ( message ) func ( * a , ** kwargs ) return wrapped
decorator that skips a test if test case is disabled .