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

Method test_incompatible

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

Source from the content-addressed store, hash-verified

5603 self.assertEqual(logging.root.level, 57)
5604
5605 def test_incompatible(self):
5606 assertRaises = self.assertRaises
5607 handlers = [logging.StreamHandler()]
5608 stream = sys.stderr
5609 formatter = logging.Formatter()
5610 assertRaises(ValueError, logging.basicConfig, filename='test.log',
5611 stream=stream)
5612 assertRaises(ValueError, logging.basicConfig, filename='test.log',
5613 handlers=handlers)
5614 assertRaises(ValueError, logging.basicConfig, stream=stream,
5615 handlers=handlers)
5616 assertRaises(ValueError, logging.basicConfig, formatter=formatter,
5617 format='%(message)s')
5618 assertRaises(ValueError, logging.basicConfig, formatter=formatter,
5619 datefmt='%H:%M:%S')
5620 assertRaises(ValueError, logging.basicConfig, formatter=formatter,
5621 style='%')
5622 # Issue 23207: test for invalid kwargs
5623 assertRaises(ValueError, logging.basicConfig, loglevel=logging.INFO)
5624 # Should pop both filename and filemode even if filename is None
5625 logging.basicConfig(filename=None, filemode='a')
5626
5627 def test_handlers(self):
5628 handlers = [

Callers

nothing calls this directly

Calls 1

assertRaisesFunction · 0.85

Tested by

no test coverage detected