def test_exceptionTodo(self):
        """
        The exception for expected failures should be shown in the
        C{printErrors} output.
        """
        try:
            1/0
        except Exception as e:
            error = e
        self.result.addExpectedFailure(self.test, Failure(error),
                                       makeTodo("todo!"))
        self.result.done()
        output = '\n'.join(self.stream.getvalue().splitlines()[3:]).strip()
        self.assertTrue(str(error) in output)

        The exception for expected failures should be shown in the
        C{printErrors} output.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py