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

Method test_config4_ok

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

Source from the content-addressed store, hash-verified

1630 self.assertRaises(Exception, self.apply_config, self.config3)
1631
1632 def test_config4_ok(self):
1633 # A config file specifying a custom formatter class.
1634 with support.captured_stdout() as output:
1635 self.apply_config(self.config4)
1636 logger = logging.getLogger()
1637 try:
1638 raise RuntimeError()
1639 except RuntimeError:
1640 logging.exception("just testing")
1641 sys.stdout.seek(0)
1642 self.assertEqual(output.getvalue(),
1643 "ERROR:root:just testing\nGot a [RuntimeError]\n")
1644 # Original logger output is empty
1645 self.assert_log_lines([])
1646
1647 def test_config5_ok(self):
1648 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