from io import StringIO
import unittest


def run_test_suites_into_buffer(suites):
    """Run a suite of unittests but into a buffer so we can read the result."""
    terminal_output = StringIO()
    unittest.TextTestRunner(stream=terminal_output).run(suites)
    return terminal_output.getvalue()