'Remove our logging stream, and restore the original logging
level.'

def tearDown(self):

    self.stream.close()
    self.root_logger.removeHandler(self.root_hdlr)
    while self.root_logger.handlers:
        h = self.root_logger.handlers[0]
        self.root_logger.removeHandler(h)
        h.close()
    self.root_logger.setLevel(self.original_logging_level)
    logging._acquireLock()
    try:
        logging._levelNames.clear()
        logging._levelNames.update(self.saved_level_names)
        logging._handlers.clear()
        logging._handlers.update(self.saved_handlers)
        logging._handlerList[:] = self.saved_handler_list
        loggerDict = logging.getLogger().manager.loggerDict
        loggerDict.clear()
        loggerDict.update(self.saved_loggers)
    finally:
        logging._releaseLock()
