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

Method test_formatter_given

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

Source from the content-addressed store, hash-verified

5754 self.assertEqual(data, r'')
5755
5756 def test_formatter_given(self):
5757 mock_formatter = Mock()
5758 mock_handler = Mock(formatter=None)
5759 with patch("logging.Formatter") as mock_formatter_init:
5760 logging.basicConfig(formatter=mock_formatter, handlers=[mock_handler])
5761 self.assertEqual(mock_handler.setFormatter.call_args_list, [call(mock_formatter)])
5762 self.assertEqual(mock_formatter_init.call_count, 0)
5763
5764 def test_formatter_not_given(self):
5765 mock_handler = Mock(formatter=None)

Callers

nothing calls this directly

Calls 4

MockClass · 0.90
patchFunction · 0.90
callFunction · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected