We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcc58ec commit 2a05c31Copy full SHA for 2a05c31
_pytest/main.py
@@ -34,8 +34,8 @@ def pytest_addoption(parser):
34
# "**/test_*.py", "**/*_test.py"]
35
#)
36
group = parser.getgroup("general", "running and selection options")
37
- group._addoption('-x', '--exitfirst', action="store_true", default=False,
38
- dest="exitfirst",
+ group._addoption('-x', '--exitfirst', action="store_const",
+ dest="maxfail", const=1,
39
help="exit instantly on first error or failed test."),
40
group._addoption('--maxfail', metavar="num",
41
action="store", type=int, dest="maxfail", default=0,
@@ -74,10 +74,10 @@ def pytest_namespace():
74
collect = dict(Item=Item, Collector=Collector, File=File, Session=Session)
75
return dict(collect=collect)
76
77
+
78
def pytest_configure(config):
79
pytest.config = config # compatibiltiy
- if config.option.exitfirst:
80
- config.option.maxfail = 1
81
82
def wrap_session(config, doit):
83
"""Skeleton command line program"""
0 commit comments