summaryrefslogtreecommitdiff
path: root/selftest/subunithelper.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-26 18:56:50 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-09-28 09:12:38 +0200
commit71f88c45a751e5f72de00dee0628b5c1b6614bf3 (patch)
treea1f82bab508a7db44b2eb773dba9ae018b9ba0cb /selftest/subunithelper.py
parentc7f6ab890e8e70f27ddc975abec58b5e0cf8d6a5 (diff)
downloadsamba-71f88c45a751e5f72de00dee0628b5c1b6614bf3.tar.gz
filter-subunit: added a --fail-immediately option
Diffstat (limited to 'selftest/subunithelper.py')
-rw-r--r--selftest/subunithelper.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index 2a5d9ecc202..c9d3daaaba0 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -258,6 +258,8 @@ class FilterOps(testtools.testresult.TestResult):
self.total_error+=1
self._ops.addError(test, details)
self.output = None
+ if self.fail_immediately:
+ raise Exception("test failed and fail_immediately set")
def addSkip(self, test, details=None):
test = self._add_prefix(test)
@@ -287,6 +289,8 @@ class FilterOps(testtools.testresult.TestResult):
if self.output:
self._ops.output_msg(self.output)
self.output = None
+ if self.fail_immediately:
+ raise Exception("test failed and fail_immediately set")
def addSuccess(self, test, details=None):
test = self._add_prefix(test)
@@ -327,7 +331,7 @@ class FilterOps(testtools.testresult.TestResult):
self._ops.end_testsuite(name, result, reason)
- def __init__(self, out, prefix, expected_failures, strip_ok_output):
+ def __init__(self, out, prefix, expected_failures, strip_ok_output, fail_immediately=False):
self._ops = out
self.output = None
self.prefix = prefix
@@ -339,3 +343,5 @@ class FilterOps(testtools.testresult.TestResult):
self.total_error = 0
self.total_fail = 0
self.error_added = 0
+ self.fail_immediately = fail_immediately
+