Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
return inner
def failfast(method):
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
inner = wraps(method)(inner)
return inner
def expectedFailure(func):
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
except Exception:
raise _ExpectedFailure(sys.exc_info())
raise _UnexpectedSuccess
wrapper = wraps(func)(wrapper)
return wrapper
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
return inner
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
return inner
@wraps(test_item)
def skip_wrapper(*args, **kwargs):
raise SkipTest(reason)
test_item = skip_wrapper
@wraps(bugnumber)
def expectedFailure_easy_wrapper(*args, **kwargs):
try:
bugnumber(*args, **kwargs)
except Exception:
raise _ExpectedFailure(sys.exc_info(), None)
raise _UnexpectedSuccess(sys.exc_info(), None)
return expectedFailure_easy_wrapper
def failfast(method):
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
inner = wraps(method)(inner)
return inner
@wraps(func)
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
except Exception:
raise _ExpectedFailure(sys.exc_info(),bugnumber)
raise _UnexpectedSuccess(sys.exc_info(),bugnumber)
return wrapper