'Execute all cleanup functions. Normally called for you after
tearDown.'

def doCleanups(self):

    result = self._resultForDoCleanups
    ok = True
    while self._cleanups:
        (function, args, kwargs) = self._cleanups.pop((-1))
        try:
            function(*args, **kwargs)
        except Exception:
            ok = False
            result.addError(self, sys.exc_info())
    return ok
