'This function mostly contains the code from
unittest.TestSuite.run. The need to override this function
occurred because we use run_test to run the testcase.'

def run(self, result, debug=False):

    topLevel = False
    if (getattr(result, '_testRunEntered', False) is False):
        result._testRunEntered = topLevel = True
    for test in self:
        if result.shouldStop:
            break
        if isinstance(test, TestSuite):
            test.run(result, debug=debug)
        else:
            self._tearDownPreviousClass(test, result)
            self._handleModuleFixture(test, result)
            self._handleClassSetUp(test, result)
            result._previousTestClass = test.__class__
            if (getattr(test.__class__, '_classSetupFailed', False) or getattr(result, '_moduleSetUpFailed', False)):
                continue
            failed = run_test(test, result)
            if (failed or result.shouldStop):
                result.shouldStop = True
                break
    if topLevel:
        self._tearDownPreviousClass(None, result)
        self._handleModuleTearDown(result)
        result._testRunEntered = False
    return result
