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

Method test_config4_ok

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

Source from the content-addressed store, hash-verified

1644 self.assertRaises(Exception, self.apply_config, self.config3)
1645
1646 def test_config4_ok(self):
1647 # A config file specifying a custom formatter class.
1648 with support.captured_stdout() as output:
1649 self.apply_config(self.config4)
1650 logger = logging.getLogger()
1651 try:
1652 raise RuntimeError()
1653 except RuntimeError:
1654 logging.exception("just testing")
1655 sys.stdout.seek(0)
1656 self.assertEqual(output.getvalue(),
1657 "ERROR:root:just testing\nGot a [RuntimeError]\n")
1658 # Original logger output is empty
1659 self.assert_log_lines([])
1660
1661 def test_config5_ok(self):
1662 self.test_config1_ok(config=self.config5)

Callers

nothing calls this directly

Calls 7

apply_configMethod · 0.95
getLoggerMethod · 0.80
assert_log_linesMethod · 0.80
exceptionMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected