How to use the unittest2.compatibility.wraps function in unittest2

To help you get started, we’ve selected a few unittest2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openbsd / src / gnu / llvm / tools / lldb / third_party / Python / module / unittest2 / unittest2 / result.py View on Github external
    @wraps(method)
    def inner(self, *args, **kw):
        if getattr(self, 'failfast', False):
            self.stop()
        return method(self, *args, **kw)
    return inner
github HenriWahl / Nagstamon / build / helpers / pyinstaller-2.1 / PyInstaller / lib / unittest2 / result.py View on Github external
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
github machawk1 / wail / build / pyinstaller-2.0 / PyInstaller / lib / unittest2 / case.py View on Github external
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
github GNOME / tracker / tests / functional-tests / unittest2 / result.py View on Github external
    @wraps(method)
    def inner(self, *args, **kw):
        if getattr(self, 'failfast', False):
            self.stop()
        return method(self, *args, **kw)
    return inner
github lanl / scout / llvm / tools / lldb / third_party / Python / module / unittest2 / unittest2 / result.py View on Github external
    @wraps(method)
    def inner(self, *args, **kw):
        if getattr(self, 'failfast', False):
            self.stop()
        return method(self, *args, **kw)
    return inner
github RuleWorld / bionetgen / bng2 / SBMLparser / pyinstaller2 / PyInstaller / lib / unittest2 / case.py View on Github external
            @wraps(test_item)
            def skip_wrapper(*args, **kwargs):
                raise SkipTest(reason)
            test_item = skip_wrapper
github apple / swift-lldb / third_party / Python / module / unittest2 / unittest2 / case.py View on Github external
        @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
github nortd / driveboardapp / other / pyinstaller / PyInstaller / lib / unittest2 / result.py View on Github external
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
github lanl / scout / llvm / tools / lldb / third_party / Python / module / unittest2 / unittest2 / case.py View on Github external
              @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