Ejemplo n.º 1
0
 def capture_log(self, level=logging.DEBUG):
     th = TestHandler()
     th.setLevel(level)
     logger.addHandler(th)
     if self._test_handler is None:
         yield th.buffer
     else:
         l = len(self._test_handler.buffer)
         yield th.buffer
         self._test_handler.buffer = self._test_handler.buffer[:l]
Ejemplo n.º 2
0
 def capture_log(self, level=logging.DEBUG):
     th = TestHandler()
     th.setLevel(level)
     logger.addHandler(th)
     if self._test_handler is None:
         yield th.buffer
     else:
         l = len(self._test_handler.buffer)
         yield th.buffer
         self._test_handler.buffer = self._test_handler.buffer[:l]
Ejemplo n.º 3
0
 def setUp(self):
     self._test_handler = None
     if self.CHECK_NO_WARNING:
         self._test_handler = th = TestHandler()
         th.setLevel(logging.WARNING)
         logger.addHandler(th)
Ejemplo n.º 4
0
 def setUp(self):
     self._test_handler = None
     if self.CHECK_NO_WARNING:
         self._test_handler = th = TestHandler()
         th.setLevel(logging.WARNING)
         logger.addHandler(th)