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

Method test_set_logger_class

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

Source from the content-addressed store, hash-verified

5210 self._test_log('critical')
5211
5212 def test_set_logger_class(self):
5213 self.assertRaises(TypeError, logging.setLoggerClass, object)
5214
5215 class MyLogger(logging.Logger):
5216 pass
5217
5218 logging.setLoggerClass(MyLogger)
5219 self.assertEqual(logging.getLoggerClass(), MyLogger)
5220
5221 logging.setLoggerClass(logging.Logger)
5222 self.assertEqual(logging.getLoggerClass(), logging.Logger)
5223
5224 def test_subclass_logger_cache(self):
5225 # bpo-37258

Callers

nothing calls this directly

Calls 3

setLoggerClassMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected