def run_suite(suite):
sys.stdout.write('<STR_LIT>' % tests.countTestCases())<EOL>res = unittest.TestResult()<EOL>suite.run(res)<EOL>if res.wasSuccessful():<EOL><INDENT>sys.stdout.write('<STR_LIT>')<EOL>return<EOL><DEDENT>sys.stdout.write('<STR_LIT:\n>')<EOL>for problems, kind in ((res.errors, '<STR_LIT:error>'),<EOL>(res.failures, '<STR_LIT>')):<EOL><INDENT>if len(problems):<EOL><INDENT>head = '<STR_LIT>' % (len(problems),<EOL>kind,<EOL>'<STR_LIT:s>' if len(problems) != <NUM_LIT:1> else '<STR_LIT>')<EOL>sys.stdout.write('<STR_LIT>' %<EOL>(head, '<STR_LIT>' * len(head)))<EOL><DEDENT>for problem in problems:<EOL><INDENT>func = problem[<NUM_LIT:0>]._testMethodName[<NUM_LIT:5>:]<EOL>environ = '<STR_LIT>' if isinstance(problem[<NUM_LIT:0>],<EOL>BrokenCtypesTest)else '<STR_LIT>'<EOL>sys.stdout.write(<EOL>'<STR_LIT>' %<EOL>(func, environ, '<STR_LIT:\n>'.join(map(lambda s: '<STR_LIT:U+0020>' + s,<EOL>problem[<NUM_LIT:1>].splitlines())))<EOL>)<EOL><DEDENT><DEDENT>sys.stdout.write('<STR_LIT>' %<EOL>(res.testsRun - len(res.failures) - len(res.errors)))<EOL>
unittest is basically a disaster, so let's do this ourselves.