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

Method test_config16_ok

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

Source from the content-addressed store, hash-verified

3555 self.addCleanup(closeFileHandler, handler, fn)
3556
3557 def test_config16_ok(self):
3558 self.apply_config(self.config16)
3559 h = logging._handlers['hand1']
3560
3561 # Custom value
3562 result = h.formatter.format(logging.makeLogRecord(
3563 {'msg': 'Hello', 'customfield': 'customvalue'}))
3564 self.assertEqual(result, 'Hello ++ customvalue')
3565
3566 # Default value
3567 result = h.formatter.format(logging.makeLogRecord(
3568 {'msg': 'Hello'}))
3569 self.assertEqual(result, 'Hello ++ defaultvalue')
3570
3571 def test_config17_ok(self):
3572 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