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

Method testAssertLogsDefaults

Lib/test/test_unittest/test_case.py:1830–1837  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1828 self.assertEqual(getattr(rec, k), v)
1829
1830 def testAssertLogsDefaults(self):
1831 # defaults: root logger, level INFO
1832 with self.assertNoStderr():
1833 with self.assertLogs() as cm:
1834 log_foo.info("1")
1835 log_foobar.debug("2")
1836 self.assertEqual(cm.output, ["INFO:foo:1"])
1837 self.assertLogRecords(cm.records, [{'name': 'foo'}])
1838
1839 def testAssertLogsTwoMatchingMessages(self):
1840 # Same, but with two matching log messages

Callers

nothing calls this directly

Calls 6

assertNoStderrMethod · 0.95
assertLogRecordsMethod · 0.95
assertLogsMethod · 0.80
infoMethod · 0.45
debugMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected