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

Method test_styled_adapter

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

Source from the content-addressed store, hash-verified

5832 self.assertIs(self.logger.manager, orig_manager)
5833
5834 def test_styled_adapter(self):
5835 # Test an example from the Cookbook.
5836 records = self.recording.records
5837 adapter = StyleAdapter(self.logger)
5838 adapter.warning('Hello, {}!', 'world')
5839 self.assertEqual(str(records[-1].msg), 'Hello, world!')
5840 self.assertEqual(records[-1].funcName, 'test_styled_adapter')
5841 adapter.log(logging.WARNING, 'Goodbye {}.', 'world')
5842 self.assertEqual(str(records[-1].msg), 'Goodbye world.')
5843 self.assertEqual(records[-1].funcName, 'test_styled_adapter')
5844
5845 def test_nested_styled_adapter(self):
5846 records = self.recording.records

Callers

nothing calls this directly

Calls 5

logMethod · 0.95
StyleAdapterClass · 0.85
strFunction · 0.85
warningMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected