'Called when the given test is about to be run'

def startTest(self, test):

    self.testsRun += 1
    self._mirrorOutput = False
    if self.buffer:
        if (self._stderr_buffer is None):
            self._stderr_buffer = StringIO()
            self._stdout_buffer = StringIO()
        sys.stdout = self._stdout_buffer
        sys.stderr = self._stderr_buffer
