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

Method test_config16_ok

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

Source from the content-addressed store, hash-verified

3621 self.addCleanup(closeFileHandler, handler, fn)
3622
3623 def test_config16_ok(self):
3624 self.apply_config(self.config16)
3625 h = logging._handlers['hand1']
3626
3627 # Custom value
3628 result = h.formatter.format(logging.makeLogRecord(
3629 {'msg': 'Hello', 'customfield': 'customvalue'}))
3630 self.assertEqual(result, 'Hello ++ customvalue')
3631
3632 # Default value
3633 result = h.formatter.format(logging.makeLogRecord(
3634 {'msg': 'Hello'}))
3635 self.assertEqual(result, 'Hello ++ defaultvalue')
3636
3637 def test_config17_ok(self):
3638 self.apply_config(self.config17)

Callers

nothing calls this directly

Calls 3

apply_configMethod · 0.95
formatMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected