def test_summary(self):
        """
        The reporter's C{printSummary} method should print the number of
        expected failures that occurred.
        """
        self.result.addExpectedFailure(self.test, Failure(Exception()),
                                       makeTodo('some reason'))
        self.result.done()
        output = self.stream.getvalue().splitlines()[-1]
        prefix = 'PASSED '
        self.assertTrue(output.startswith(prefix))
        self.assertEqual(output[len(prefix):].strip(),
                         '(expectedFailures=1)')

        The reporter's C{printSummary} method should print the number of
        expected failures that occurred.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py