def test_groupResults(self):
        """
        If two different tests have the same error, L{Reporter._groupResults}
        includes them together in one of the tuples in the list it returns.
        """
        try:
            raise RuntimeError('foo')
        except RuntimeError:
            self.result.addError(self, sys.exc_info())
            self.result.addError(self.test, sys.exc_info())
        try:
            raise RuntimeError('bar')
        except RuntimeError:
            extra = sample.FooTest('test_bar')
            self.result.addError(extra, sys.exc_info())
        self.result.done()
        grouped = self.result._groupResults(
            self.result.errors, self.result._formatFailureTraceback)
        self.assertEqual(grouped[0][1], [self, self.test])
        self.assertEqual(grouped[1][1], [extra])

        If two different tests have the same error, L{Reporter._groupResults}
        includes them together in one of the tuples in the list it returns.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py