MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_handlers

Method test_handlers

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

Source from the content-addressed store, hash-verified

5528 logging.basicConfig(filename=None, filemode='a')
5529
5530 def test_handlers(self):
5531 handlers = [
5532 logging.StreamHandler(),
5533 logging.StreamHandler(sys.stdout),
5534 logging.StreamHandler(),
5535 ]
5536 f = logging.Formatter()
5537 handlers[2].setFormatter(f)
5538 logging.basicConfig(handlers=handlers)
5539 self.assertIs(handlers[0], logging.root.handlers[0])
5540 self.assertIs(handlers[1], logging.root.handlers[1])
5541 self.assertIs(handlers[2], logging.root.handlers[2])
5542 self.assertIsNotNone(handlers[0].formatter)
5543 self.assertIsNotNone(handlers[1].formatter)
5544 self.assertIs(handlers[2].formatter, f)
5545 self.assertIs(handlers[0].formatter, handlers[1].formatter)
5546
5547 def test_force(self):
5548 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