summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/runner.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-22 01:13:48 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-03-22 01:13:48 (GMT)
commit8769fd8a17dad1b1861c04ea75ce46478d21a34d (patch)
treed560c681b9e306646f9f54eb3e7c4bba29b0b7ef /Lib/unittest/runner.py
parentdccc1fcfafd37c6fd94ca766516cb4903b29668e (diff)
downloadcpython-8769fd8a17dad1b1861c04ea75ce46478d21a34d.zip
cpython-8769fd8a17dad1b1861c04ea75ce46478d21a34d.tar.gz
cpython-8769fd8a17dad1b1861c04ea75ce46478d21a34d.tar.bz2
Merged revisions 79265-79266 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79265 | michael.foord | 2010-03-21 20:01:34 -0500 (Sun, 21 Mar 2010) | 1 line -f/--failfast command line option for unittest. Issue 8074. Documentation still needed. Plus minor change to test_unittest to allow it to be run with python -m test.unittest ........ r79266 | michael.foord | 2010-03-21 20:02:23 -0500 (Sun, 21 Mar 2010) | 1 line Fix failing test committed by accident. ........
Diffstat (limited to 'Lib/unittest/runner.py')
-rw-r--r--Lib/unittest/runner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/unittest/runner.py b/Lib/unittest/runner.py
index 1729f1d..5fe7d67 100644
--- a/Lib/unittest/runner.py
+++ b/Lib/unittest/runner.py
@@ -124,10 +124,11 @@ class TextTestRunner(object):
resultclass = TextTestResult
def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
- resultclass=None):
+ failfast=False, resultclass=None):
self.stream = _WritelnDecorator(stream)
self.descriptions = descriptions
self.verbosity = verbosity
+ self.failfast = failfast
if resultclass is not None:
self.resultclass = resultclass
@@ -137,6 +138,7 @@ class TextTestRunner(object):
def run(self, test):
"Run the given test case or test suite."
result = self._makeResult()
+ result.failfast = self.failfast
startTime = time.time()
startTestRun = getattr(result, 'startTestRun', None)
if startTestRun is not None: