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

Method test_config4_ok

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

Source from the content-addressed store, hash-verified

3383 self.assertRaises(Exception, self.apply_config, self.config3)
3384
3385 def test_config4_ok(self):
3386 # A config specifying a custom formatter class.
3387 with support.captured_stdout() as output:
3388 self.apply_config(self.config4)
3389 self.check_handler('hand1', logging.StreamHandler)
3390 #logger = logging.getLogger()
3391 try:
3392 raise RuntimeError()
3393 except RuntimeError:
3394 logging.exception("just testing")
3395 sys.stdout.seek(0)
3396 self.assertEqual(output.getvalue(),
3397 "ERROR:root:just testing\nGot a [RuntimeError]\n")
3398 # Original logger output is empty
3399 self.assert_log_lines([])
3400
3401 def test_config4a_ok(self):
3402 # A config specifying a custom formatter class.

Callers

nothing calls this directly

Calls 7

apply_configMethod · 0.95
check_handlerMethod · 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