MCPcopy Create free account
hub / github.com/python/cpython / test_config15_ok

Method test_config15_ok

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

Source from the content-addressed store, hash-verified

3596 self.assertEndsWith(output.getvalue(), 'Exclamation!\n')
3597
3598 def test_config15_ok(self):
3599
3600 with self.check_no_resource_warning():
3601 fn = make_temp_file(".log", "test_logging-X-")
3602
3603 config = {
3604 "version": 1,
3605 "handlers": {
3606 "file": {
3607 "class": "logging.FileHandler",
3608 "filename": fn,
3609 "encoding": "utf-8",
3610 }
3611 },
3612 "root": {
3613 "handlers": ["file"]
3614 }
3615 }
3616
3617 self.apply_config(config)
3618 self.apply_config(config)
3619
3620 handler = logging.root.handlers[0]
3621 self.addCleanup(closeFileHandler, handler, fn)
3622
3623 def test_config16_ok(self):
3624 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