MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_extra_in_records

Method test_extra_in_records

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

Source from the content-addressed store, hash-verified

5887 self.assertGreater(records[-1].lineno, lineno)
5888
5889 def test_extra_in_records(self):
5890 self.adapter = logging.LoggerAdapter(logger=self.logger,
5891 extra={'foo': '1'})
5892
5893 self.adapter.critical('foo should be here')
5894 self.assertEqual(len(self.recording.records), 1)
5895 record = self.recording.records[0]
5896 self.assertTrue(hasattr(record, 'foo'))
5897 self.assertEqual(record.foo, '1')
5898
5899 def test_extra_not_merged_by_default(self):
5900 self.adapter.critical('foo should NOT be here', extra={'foo': 'nope'})

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