def _run_suite(suite):
if verbose:<EOL><INDENT>runner = unittest.TextTestRunner(sys.stdout, verbosity=<NUM_LIT:2>,<EOL>failfast=failfast)<EOL><DEDENT>else:<EOL><INDENT>runner = BasicTestRunner()<EOL><DEDENT>result = runner.run(suite)<EOL>if not result.wasSuccessful():<EOL><INDENT>if len(result.errors) == <NUM_LIT:1> and not result.failures:<EOL><INDENT>err = result.errors[<NUM_LIT:0>][<NUM_LIT:1>]<EOL><DEDENT>elif len(result.failures) == <NUM_LIT:1> and not result.errors:<EOL><INDENT>err = result.failures[<NUM_LIT:0>][<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>err = "<STR_LIT>"<EOL>if not verbose: err += "<STR_LIT>"<EOL><DEDENT>raise TestFailed(err)<EOL><DEDENT>
Run tests from a unittest.TestSuite-derived class.