'Log all unhandled exceptions, clear logged exceptions and raise to fail the currently running test.'

def check_exceptions(self):

    if self.exc_counter:
        lines = self._lines
        self._lines = []
        exc_counter = self.exc_counter
        self.exc_counter = 0
        last_exc = self.last_exc
        self.last_exc = 0
        self._logger.critical("The    following    unhandled    exceptions    where    raised    during    this    test's    execution:")
        for line in lines:
            self._logger.critical(line)
        raise Exception(('Test    raised    %d    unhandled    exceptions,    last    one    was:    %s' % (exc_counter, last_exc)))
