summaryrefslogtreecommitdiff
path: root/Lib/unittest/result.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/result.py')
-rw-r--r--Lib/unittest/result.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py
index b967a60a01..8e0a64322b 100644
--- a/Lib/unittest/result.py
+++ b/Lib/unittest/result.py
@@ -121,7 +121,6 @@ class TestResult(object):
self.failures.append((test, self._exc_info_to_string(err, test)))
self._mirrorOutput = True
- @failfast
def addSubTest(self, test, subtest, err):
"""Called at the end of a subtest.
'err' is None if the subtest ended successfully, otherwise it's a
@@ -130,6 +129,8 @@ class TestResult(object):
# By default, we don't do anything with successful subtests, but
# more sophisticated test results might want to record them.
if err is not None:
+ if getattr(self, 'failfast', False):
+ self.stop()
if issubclass(err[0], test.failureException):
errors = self.failures
else: