Skip to content

Commit 3fd8257

Browse files
add test for --maxfail=NUM overiding -x
1 parent 2a05c31 commit 3fd8257

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

testing/test_session.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ def test_minus_x_import_error(self, testdir):
197197
colfail = [x for x in finished if x.failed]
198198
assert len(colfail) == 1
199199

200+
def test_minus_x_overriden_by_maxfail(self, testdir):
201+
testdir.makepyfile(__init__="")
202+
testdir.makepyfile(test_one="xxxx", test_two="yyyy", test_third="zzz")
203+
reprec = testdir.inline_run("-x", "--maxfail=2", testdir.tmpdir)
204+
finished = reprec.getreports("pytest_collectreport")
205+
colfail = [x for x in finished if x.failed]
206+
assert len(colfail) == 2
207+
200208

201209
def test_plugin_specify(testdir):
202210
pytest.raises(ImportError, """

0 commit comments

Comments
 (0)