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

Method test_percent

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

Source from the content-addressed store, hash-verified

4523 return logging.makeLogRecord(result)
4524
4525 def test_percent(self):
4526 # Test %-formatting
4527 r = self.get_record()
4528 f = logging.Formatter('${%(message)s}')
4529 self.assertEqual(f.format(r), '${Message with 2 placeholders}')
4530 f = logging.Formatter('%(random)s')
4531 self.assertRaises(ValueError, f.format, r)
4532 self.assertFalse(f.usesTime())
4533 f = logging.Formatter('%(asctime)s')
4534 self.assertTrue(f.usesTime())
4535 f = logging.Formatter('%(asctime)-15s')
4536 self.assertTrue(f.usesTime())
4537 f = logging.Formatter('%(asctime)#15s')
4538 self.assertTrue(f.usesTime())
4539
4540 def test_braces(self):
4541 # Test {}-formatting

Callers

nothing calls this directly

Calls 7

get_recordMethod · 0.95
formatMethod · 0.95
usesTimeMethod · 0.95
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected