diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-11-23 15:55:11 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-11-23 15:55:11 +0100 |
commit | 45d2905e417a1edcec07d77bb7a2b5e16a6d7a85 (patch) | |
tree | ad2722572cd651c81b8f7703bc2fecbcd30e27d0 /Lib/unittest/result.py | |
parent | 07dc93c935aba09f828213684d75f56079c75d31 (diff) | |
download | cpython-45d2905e417a1edcec07d77bb7a2b5e16a6d7a85.tar.gz |
Issue #22894: TestCase.subTest() would cause the test suite to be stopped when in failfast mode, even in the absence of failures.
Diffstat (limited to 'Lib/unittest/result.py')
-rw-r--r-- | Lib/unittest/result.py | 3 |
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: |