'Run the given test case or test suite.'

def run(self, test):

    result = self._makeResult()
    registerResult(result)
    result.failfast = self.failfast
    result.buffer = self.buffer
    with warnings.catch_warnings():
        if self.warnings:
            warnings.simplefilter(self.warnings)
            if (self.warnings in ['default', 'always']):
                warnings.filterwarnings('module', category=DeprecationWarning, message='Please    use    assert\\w+    instead.')
        startTime = time.time()
        startTestRun = getattr(result, 'startTestRun', None)
        if (startTestRun is not None):
            startTestRun()
        try:
            test(result)
        finally:
            stopTestRun = getattr(result, 'stopTestRun', None)
            if (stopTestRun is not None):
                stopTestRun()
        stopTime = time.time()
    timeTaken = (stopTime - startTime)
    result.printErrors()
    if hasattr(result, 'separator2'):
        self.stream.writeln(result.separator2)
    run = result.testsRun
    self.stream.writeln(('Ran    %d    test%s    in    %.3fs' % (run, (((run != 1) and 's') or ''), timeTaken)))
    self.stream.writeln()
    expectedFails = unexpectedSuccesses = skipped = 0
    try:
        results = map(len, (result.expectedFailures, result.unexpectedSuccesses, result.skipped))
    except AttributeError:
        pass
    else:
        (expectedFails, unexpectedSuccesses, skipped) = results
    infos = []
    if (not result.wasSuccessful()):
        self.stream.write('FAILED')
        (failed, errored) = (len(result.failures), len(result.errors))
        if failed:
            infos.append(('failures=%d' % failed))
        if errored:
            infos.append(('errors=%d' % errored))
    else:
        self.stream.write('OK')
    if skipped:
        infos.append(('skipped=%d' % skipped))
    if expectedFails:
        infos.append(('expected    failures=%d' % expectedFails))
    if unexpectedSuccesses:
        infos.append(('unexpected    successes=%d' % unexpectedSuccesses))
    if infos:
        self.stream.writeln(('    (%s)' % (',    '.join(infos),)))
    else:
        self.stream.write('\n')
    return result
