Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1049)

Unified Diff: presubmit_canned_checks.py

Issue 118415: Fixes RunPythonUnitTests output. (Closed)
Patch Set: merge to trunk Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index f31b1687a352e306dd1bd415d31e702a44c416e2..d020c165925e7a51d969c23f85fc6a6e009d1a20 100755
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -169,9 +169,11 @@ def RunPythonUnitTests(input_api, output_api, unit_tests):
outputs.append(message_type("Failed to load %s" % unit_test,
long_text=input_api.traceback.format_exc()))
- results = input_api.unittest.TextTestRunner(verbosity=0).run(
+ buffer = input_api.cStringIO.StringIO()
+ results = input_api.unittest.TextTestRunner(stream=buffer, verbosity=0).run(
input_api.unittest.TestSuite(tests_suite))
if not results.wasSuccessful():
outputs.append(message_type("%d unit tests failed." %
- (len(results.failures) + len(results.errors))))
+ (len(results.failures) + len(results.errors)),
+ long_text=buffer.getvalue()))
return outputs
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698