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

Method test_config15_ok

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

Source from the content-addressed store, hash-verified

3530 self.assertTrue(output.getvalue().endswith('Exclamation!\n'))
3531
3532 def test_config15_ok(self):
3533
3534 with self.check_no_resource_warning():
3535 fn = make_temp_file(".log", "test_logging-X-")
3536
3537 config = {
3538 "version": 1,
3539 "handlers": {
3540 "file": {
3541 "class": "logging.FileHandler",
3542 "filename": fn,
3543 "encoding": "utf-8",
3544 }
3545 },
3546 "root": {
3547 "handlers": ["file"]
3548 }
3549 }
3550
3551 self.apply_config(config)
3552 self.apply_config(config)
3553
3554 handler = logging.root.handlers[0]
3555 self.addCleanup(closeFileHandler, handler, fn)
3556
3557 def test_config16_ok(self):
3558 self.apply_config(self.config16)

Callers

nothing calls this directly

Calls 3

apply_configMethod · 0.95
make_temp_fileFunction · 0.85
addCleanupMethod · 0.80

Tested by

no test coverage detected