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

Method test_config4_ok

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

Source from the content-addressed store, hash-verified

3326 self.assertRaises(Exception, self.apply_config, self.config3)
3327
3328 def test_config4_ok(self):
3329 # A config specifying a custom formatter class.
3330 with support.captured_stdout() as output:
3331 self.apply_config(self.config4)
3332 self.check_handler('hand1', logging.StreamHandler)
3333 #logger = logging.getLogger()
3334 try:
3335 raise RuntimeError()
3336 except RuntimeError:
3337 logging.exception("just testing")
3338 sys.stdout.seek(0)
3339 self.assertEqual(output.getvalue(),
3340 "ERROR:root:just testing\nGot a [RuntimeError]\n")
3341 # Original logger output is empty
3342 self.assert_log_lines([])
3343
3344 def test_config4a_ok(self):
3345 # 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