def test_printResults(self):
        """
        L{Reporter._printResults} uses the results list and formatter callable
        passed to it to produce groups of results to write to its output
        stream.
        """
        def formatter(n):
            return str(n) + '\n'
        first = sample.FooTest('test_foo')
        second = sample.FooTest('test_bar')
        third = sample.PyunitTest('test_foo')
        self.result._printResults(
            'FOO', [(first, 1), (second, 1), (third, 2)], formatter)
        self.assertEqual(
            self.stream.getvalue(),
            "%(double separator)s\n"
            "FOO\n"
            "1\n"
            "\n"
            "%(first)s\n"
            "%(second)s\n"
            "%(double separator)s\n"
            "FOO\n"
            "2\n"
            "\n"
            "%(third)s\n" % {
                'double separator': self.result._doubleSeparator,
                'first': first.id(),
                'second': second.id(),
                'third': third.id(),
                })

        L{Reporter._printResults} uses the results list and formatter callable
        passed to it to produce groups of results to write to its output
        stream.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py