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

Method test_config0_ok

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

Source from the content-addressed store, hash-verified

3279 self.assertIsInstance(h, cls)
3280
3281 def test_config0_ok(self):
3282 # A simple config which overrides the default settings.
3283 with support.captured_stdout() as output:
3284 self.apply_config(self.config0)
3285 self.check_handler('hand1', logging.StreamHandler)
3286 logger = logging.getLogger()
3287 # Won't output anything
3288 logger.info(self.next_message())
3289 # Outputs a message
3290 logger.error(self.next_message())
3291 self.assert_log_lines([
3292 ('ERROR', '2'),
3293 ], stream=output)
3294 # Original logger output is empty.
3295 self.assert_log_lines([])
3296
3297 def test_config1_ok(self, config=config1):
3298 # 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