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

Method test_config4a_ok

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

Source from the content-addressed store, hash-verified

3399 self.assert_log_lines([])
3400
3401 def test_config4a_ok(self):
3402 # A config specifying a custom formatter class.
3403 with support.captured_stdout() as output:
3404 self.apply_config(self.config4a)
3405 #logger = logging.getLogger()
3406 try:
3407 raise RuntimeError()
3408 except RuntimeError:
3409 logging.exception("just testing")
3410 sys.stdout.seek(0)
3411 self.assertEqual(output.getvalue(),
3412 "ERROR:root:just testing\nGot a [RuntimeError]\n")
3413 # Original logger output is empty
3414 self.assert_log_lines([])
3415
3416 def test_config5_ok(self):
3417 self.test_config1_ok(config=self.config5)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected