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

Method test_child_loggers

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

Source from the content-addressed store, hash-verified

4259
4260class ChildLoggerTest(BaseTest):
4261 def test_child_loggers(self):
4262 r = logging.getLogger()
4263 l1 = logging.getLogger('abc')
4264 l2 = logging.getLogger('def.ghi')
4265 c1 = r.getChild('xyz')
4266 c2 = r.getChild('uvw.xyz')
4267 self.assertIs(c1, logging.getLogger('xyz'))
4268 self.assertIs(c2, logging.getLogger('uvw.xyz'))
4269 c1 = l1.getChild('def')
4270 c2 = c1.getChild('ghi')
4271 c3 = l1.getChild('def.ghi')
4272 self.assertIs(c1, logging.getLogger('abc.def'))
4273 self.assertIs(c2, logging.getLogger('abc.def.ghi'))
4274 self.assertIs(c2, c3)
4275
4276 def test_get_children(self):
4277 r = logging.getLogger()

Callers

nothing calls this directly

Calls 3

getLoggerMethod · 0.80
getChildMethod · 0.80
assertIsMethod · 0.45

Tested by

no test coverage detected