def longTest(testMethod):
 def newTestMethod(*args, **kwargs):
  if (TestOptionParser.__long__ is None):
   raise Exception('TestOptionParser must be used in order to use @longTestdecorator.')
  if TestOptionParser.__long__:
   return testMethod(*args, **kwargs)
  else:
   msg = ('Skipping long test: %s' % testMethod.__name__)
   return unittest.skip(msg)(testMethod)(*args, **kwargs)
 return newTestMethod

def longTest ( testMethod ) : def newTestMethod ( * args , ** kwargs ) : if ( TestOptionParser . __long__ is None ) : raise Exception ( 'TestOptionParser must be used in order to use @longTestdecorator.' ) if TestOptionParser . __long__ : return testMethod ( * args , ** kwargs ) else : msg = ( 'Skipping long test: %s' % testMethod . __name__ ) return unittest . skip ( msg ) ( testMethod ) ( * args , ** kwargs ) return newTestMethod
decorator for specifying tests that only run when --long is specified .