From 0ce167277a1999ceab79c84a871ed069c97f4ca7 Mon Sep 17 00:00:00 2001 From: Michael Foord Date: Mon, 22 Mar 2010 01:56:54 +0000 Subject: [PATCH] expected failure should not trigger failfast behavior in unittest. --- Lib/test/test_unittest.py | 6 ------ Lib/unittest/main.py | 2 +- Lib/unittest/result.py | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index 05c0182bfaf..5d51ffc547c 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -2113,12 +2113,6 @@ class Test_TestResult(TestCase): result.addUnexpectedSuccess(None) self.assertTrue(result.shouldStop) - result = unittest.TestResult() - result._exc_info_to_string = lambda *_: '' - result.failfast = True - result.addExpectedFailure(None, None) - self.assertTrue(result.shouldStop) - def testFailFastSetByRunner(self): runner = unittest.TextTestRunner(stream=StringIO(), failfast=True) def test(result): diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py index 8fd23c0691e..35466ccfabc 100644 --- a/Lib/unittest/main.py +++ b/Lib/unittest/main.py @@ -178,7 +178,7 @@ class TestProgram(object): testRunner = self.testRunner(verbosity=self.verbosity, failfast=self.failfast) except TypeError: - # didn't accept the verbosity or failfast argument + # didn't accept the verbosity or failfast arguments testRunner = self.testRunner() else: # it is assumed to be a TestRunner instance diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py index 96d56a114e9..ec80e8eea58 100644 --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -81,7 +81,6 @@ class TestResult(object): """Called when a test is skipped.""" self.skipped.append((test, reason)) - @failfast def addExpectedFailure(self, test, err): """Called when an expected failure/error occured.""" self.expectedFailures.append(