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

Method test_extra_merged

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

Source from the content-addressed store, hash-verified

5903 self.assertFalse(hasattr(record, 'foo'))
5904
5905 def test_extra_merged(self):
5906 self.adapter = logging.LoggerAdapter(logger=self.logger,
5907 extra={'foo': '1'},
5908 merge_extra=True)
5909
5910 self.adapter.critical('foo and bar should be here', extra={'bar': '2'})
5911 self.assertEqual(len(self.recording.records), 1)
5912 record = self.recording.records[0]
5913 self.assertTrue(hasattr(record, 'foo'))
5914 self.assertTrue(hasattr(record, 'bar'))
5915 self.assertEqual(record.foo, '1')
5916 self.assertEqual(record.bar, '2')
5917
5918 def test_extra_merged_log_call_has_precedence(self):
5919 self.adapter = logging.LoggerAdapter(logger=self.logger,

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
hasattrFunction · 0.85
assertTrueMethod · 0.80
criticalMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected