Closed 0c7c4ccc-8b0f-427f-9557-16a861df6269 closed 9 years ago
When running a test suite with the -f flag (--failfast), unittest seems to stop running tests once it exits a with self.subTest block.
In the attached script, run it without -f and test_b will run and fail. Run it with the -f flag and only the test_a test will run. test_b will not run and no errors will be reported.
I noticed this bug in 3.4.1 on OS X
Here is a patch.
Looks good, thanks for the quick response.
New changeset 993e8f795194 by Antoine Pitrou in branch '3.4': Issue bpo-22894: TestCase.subTest() would cause the test suite to be stopped when in failfast mode, even in the absence of failures. https://hg.python.org/cpython/rev/993e8f795194
New changeset 04103cece49d by Antoine Pitrou in branch 'default': Issue bpo-22894: TestCase.subTest() would cause the test suite to be stopped when in failfast mode, even in the absence of failures. https://hg.python.org/cpython/rev/04103cece49d
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at =
created_at =
labels = ['type-bug', 'tests']
title = 'unittest.TestCase.subTest causes all subsequent tests to be skipped in failfast mode'
updated_at =
user = 'https://bugs.python.org/TreyCucco'
```
bugs.python.org fields:
```python
activity =
actor = 'pitrou'
assignee = 'none'
closed = True
closed_date =
closer = 'pitrou'
components = ['Tests']
creation =
creator = 'Trey.Cucco'
dependencies = []
files = ['37218', '37238']
hgrepos = []
issue_num = 22894
keywords = ['patch']
message_count = 4.0
messages = ['231305', '231449', '231468', '231562']
nosy_count = 7.0
nosy_names = ['pitrou', 'rbcollins', 'ezio.melotti', 'michael.foord', 'ethan.furman', 'python-dev', 'Trey.Cucco']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue22894'
versions = ['Python 3.4', 'Python 3.5']
```