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

Unified Diff: expect_tests/unittest_helper.py

Issue 2121343004: Expose whether unittest failed to tearDown(). (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: expect_tests/unittest_helper.py
diff --git a/expect_tests/unittest_helper.py b/expect_tests/unittest_helper.py
index 8c6eb4782ded0e20836fc3a3d0a7d75f843c75f2..e8b5270c50bb2ae736632d8112669f22ec01fcaa 100644
--- a/expect_tests/unittest_helper.py
+++ b/expect_tests/unittest_helper.py
@@ -26,8 +26,14 @@ def _RunTestCaseSingle(test_case, test_name, test_instance=None):
# class...
test_instance = test_instance or test_case('__init__')
test_instance.setUp()
+ test_instance._test_failed_with_exception = False
try:
return Result(getattr(test_instance, test_name)())
+ except KeyboardInterrupt:
+ raise
+ except:
+ test_instance._test_failed_with_exception = True
+ raise
finally:
test_instance.tearDown()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698