MCPcopy Index your code
hub / github.com/python/cpython / test_handlers

Method test_handlers

Lib/test/test_logging.py:5627–5642  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5625 logging.basicConfig(filename=None, filemode='a')
5626
5627 def test_handlers(self):
5628 handlers = [
5629 logging.StreamHandler(),
5630 logging.StreamHandler(sys.stdout),
5631 logging.StreamHandler(),
5632 ]
5633 f = logging.Formatter()
5634 handlers[2].setFormatter(f)
5635 logging.basicConfig(handlers=handlers)
5636 self.assertIs(handlers[0], logging.root.handlers[0])
5637 self.assertIs(handlers[1], logging.root.handlers[1])
5638 self.assertIs(handlers[2], logging.root.handlers[2])
5639 self.assertIsNotNone(handlers[0].formatter)
5640 self.assertIsNotNone(handlers[1].formatter)
5641 self.assertIs(handlers[2].formatter, f)
5642 self.assertIs(handlers[0].formatter, handlers[1].formatter)
5643
5644 def test_force(self):
5645 old_string_io = io.StringIO()

Callers

nothing calls this directly

Calls 3

setFormatterMethod · 0.80
assertIsNotNoneMethod · 0.80
assertIsMethod · 0.45

Tested by

no test coverage detected