def test_formatEventWeirdFormat(self):
        """
        Formatting an event with a bogus format.
        """
        event = dict(log_format=object(), foo=1, bar=2)
        result = formatEvent(event)

        self.assertIn("Log format must be unicode or bytes", result)
        self.assertIn(repr(event), result)

        Formatting an event with a bogus format.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_format.py