summaryrefslogtreecommitdiff
path: root/python/subunit/__init__.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2012-12-17 20:24:28 +1300
committerRobert Collins <robertc@robertcollins.net>2012-12-17 20:24:28 +1300
commitfba3a6bf6d5e6226b007b89a6043e8b9c56051c3 (patch)
tree7fcfe11b099622ccfdacff59a9fd93eebfa25725 /python/subunit/__init__.py
parent1eda12642eed8ffdd84522c53a2e057ee6959948 (diff)
downloadsubunit-fba3a6bf6d5e6226b007b89a6043e8b9c56051c3.tar.gz
* The ``failfast`` option to ``subunit.run`` will now work. The dependency on
testtools has been raised to 0.9.23 to permit this. (Robert Collins, #1090582)
Diffstat (limited to 'python/subunit/__init__.py')
-rw-r--r--python/subunit/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index 6015c0e..ebe6e8c 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -636,6 +636,8 @@ class TestProtocolClient(testresult.TestResult):
to subunit.Content objects.
"""
self._addOutcome("error", test, error=error, details=details)
+ if self.failfast:
+ self.stop()
def addExpectedFailure(self, test, error=None, details=None):
"""Report an expected failure in test test.
@@ -666,6 +668,8 @@ class TestProtocolClient(testresult.TestResult):
to subunit.Content objects.
"""
self._addOutcome("failure", test, error=error, details=details)
+ if self.failfast:
+ self.stop()
def _addOutcome(self, outcome, test, error=None, details=None,
error_permitted=True):
@@ -730,6 +734,8 @@ class TestProtocolClient(testresult.TestResult):
"""
self._addOutcome("uxsuccess", test, details=details,
error_permitted=False)
+ if self.failfast:
+ self.stop()
def startTest(self, test):
"""Mark a test as starting its test run."""