def test_failure(self):
        """
        An event with a failure logs the failure details as well.
        """
        def failing_func():
            1 / 0
        try:
            failing_func()
        except ZeroDivisionError:
            failure = Failure()
        event = dict(log_format='Hi mom', who='me', log_failure=failure)
        records, output = self.logEvent(event)
        self.assertEqual(len(records), 1)
        self.assertIn(u'Hi mom', output)
        self.assertIn(u'in failing_func', output)
        self.assertIn(u'ZeroDivisionError', output)

        An event with a failure logs the failure details as well.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_stdlib.py