def test_format_object(self, _format): x = ColorFormatter() x.use_color = True record = Mock() record.levelname = 'ERROR' record.msg = object() assert x.format(record)
def test_format_raises_no_color(self, safe_str): x = ColorFormatter(use_color=False) record = Mock() record.levelname = 'ERROR' record.msg = 'HELLO' record.exc_text = 'error text' x.format(record) assert safe_str.call_count == 1