Beispiel #1
0
 def tearDown(self):
     handler = self.loghandler
     # All this is necessary to properly shut down the logging system and
     # avoid a regrtest complaint.  Thanks to Vinay Sajip for the help.
     handler.close()
     logger.removeHandler(handler)
     for ref in weakref.getweakrefs(handler):
         logging._removeHandlerRef(ref)
     del self.loghandler
     logger.setLevel(self._old_level)
     super(LoggingCatcher, self).tearDown()
Beispiel #2
0
 def tearDown(self):
     handler = self.loghandler
     # All this is necessary to properly shut down the logging system and
     # avoid a regrtest complaint.  Thanks to Vinay Sajip for the help.
     handler.close()
     logger.removeHandler(handler)
     for ref in weakref.getweakrefs(handler):
         logging._removeHandlerRef(ref)
     del self.loghandler
     logger.setLevel(self._old_level)
     super(LoggingCatcher, self).tearDown()
Beispiel #3
0
 def setUp(self):
     super(LoggingCatcher, self).setUp()
     self.loghandler = handler = _TestHandler()
     self._old_level = logger.level
     logger.addHandler(handler)
     logger.setLevel(logging.DEBUG)  # we want all messages
Beispiel #4
0
 def setUp(self):
     super(LoggingCatcher, self).setUp()
     self.loghandler = handler = _TestHandler()
     self._old_level = logger.level
     logger.addHandler(handler)
     logger.setLevel(logging.DEBUG)  # we want all messages