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

Method test_config0_ok

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

Source from the content-addressed store, hash-verified

3336 self.assertIsInstance(h, cls)
3337
3338 def test_config0_ok(self):
3339 # A simple config which overrides the default settings.
3340 with support.captured_stdout() as output:
3341 self.apply_config(self.config0)
3342 self.check_handler('hand1', logging.StreamHandler)
3343 logger = logging.getLogger()
3344 # Won't output anything
3345 logger.info(self.next_message())
3346 # Outputs a message
3347 logger.error(self.next_message())
3348 self.assert_log_lines([
3349 ('ERROR', '2'),
3350 ], stream=output)
3351 # Original logger output is empty.
3352 self.assert_log_lines([])
3353
3354 def test_config1_ok(self, config=config1):
3355 # A config defining a sub-parser as well.

Callers

nothing calls this directly

Calls 7

apply_configMethod · 0.95
check_handlerMethod · 0.95
getLoggerMethod · 0.80
next_messageMethod · 0.80
assert_log_linesMethod · 0.80
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected