File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ UNRELEASED
5
+ ----------
6
+
7
+ * Fixed bug were an extra test would execute when ``-x/--exitfirst `` was used (`#139 `_).
8
+
9
+ .. _#139 : https://github.com/pytest-dev/pytest-subtests/pull/139
10
+
4
11
0.13.0 (2024-07-07)
5
12
-------------------
6
13
Original file line number Diff line number Diff line change @@ -242,9 +242,6 @@ def __exit__(
242
242
__tracebackhide__ = True
243
243
try :
244
244
if exc_val is not None :
245
- if self .request .session .shouldfail :
246
- return False
247
-
248
245
exc_info = ExceptionInfo .from_exception (exc_val )
249
246
else :
250
247
exc_info = None
@@ -275,6 +272,9 @@ def __exit__(
275
272
node = self .request .node , call = call_info , report = sub_report
276
273
)
277
274
275
+ if exc_val is not None :
276
+ if self .request .session .shouldfail :
277
+ return False
278
278
return True
279
279
280
280
Original file line number Diff line number Diff line change @@ -593,15 +593,16 @@ def test_foo(subtests):
593
593
assert False
594
594
595
595
with subtests.test("sub2"):
596
- pass
596
+ assert False
597
597
"""
598
598
)
599
599
result = pytester .runpytest ("--exitfirst" )
600
- assert result .parseoutcomes ()["failed" ] == 1
600
+ assert result .parseoutcomes ()["failed" ] == 2
601
601
result .stdout .fnmatch_lines (
602
602
[
603
603
"*[[]sub1[]] SUBFAIL test_exitfirst.py::test_foo - assert False*" ,
604
- "* stopping after 1 failures*" ,
604
+ "FAILED test_exitfirst.py::test_foo - assert False" ,
605
+ "* stopping after 2 failures*" ,
605
606
],
606
607
consecutive = True ,
607
608
)
You can’t perform that action at this time.
0 commit comments