def test_summaryColoredFailure(self):
        """
        The summary in case of failure should have a good count of errors
        and be colored properly.
        """
        try:
            raise RuntimeError('foo')
        except RuntimeError:
            self.result.addError(self, sys.exc_info())
        self.result.done()
        self.assertEqual(self.log[1], (self.result.FAILURE, 'FAILED'))
        self.assertEqual(
            self.stream.getvalue().splitlines()[-1].strip(), "(errors=1)")

        The summary in case of failure should have a good count of errors
        and be colored properly.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py