MCPcopy Index your code
hub / github.com/python/cpython / test_nested_styled_adapter

Method test_nested_styled_adapter

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

Source from the content-addressed store, hash-verified

5954 self.assertEqual(records[-1].funcName, 'test_styled_adapter')
5955
5956 def test_nested_styled_adapter(self):
5957 records = self.recording.records
5958 adapter = PrefixAdapter(self.logger)
5959 adapter.prefix = '{}'
5960 adapter2 = StyleAdapter(adapter)
5961 adapter2.warning('Hello, {}!', 'world')
5962 self.assertEqual(str(records[-1].msg), '{} Hello, world!')
5963 self.assertEqual(records[-1].funcName, 'test_nested_styled_adapter')
5964 adapter2.log(logging.WARNING, 'Goodbye {}.', 'world')
5965 self.assertEqual(str(records[-1].msg), '{} Goodbye world.')
5966 self.assertEqual(records[-1].funcName, 'test_nested_styled_adapter')
5967
5968 def test_find_caller_with_stacklevel(self):
5969 the_level = 1

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected