#9062 - Allow --stepwise-skip to implicitly enable --stepwise (#9064)

* #9062 - Allow `--stepwise-skip` to implicitly enable `--stepwise`

* Update changelog/9062.improvement.rst

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
Simon K
2021-08-30 19:24:14 +01:00
committed by GitHub
parent af42e7154a
commit 740abd9684
4 changed files with 37 additions and 3 deletions

View File

@@ -31,13 +31,16 @@ def pytest_addoption(parser: Parser) -> None:
action="store_true",
default=False,
dest="stepwise_skip",
help="ignore the first failing test but stop on the next failing test",
help="ignore the first failing test but stop on the next failing test.\n"
"implicitly enables --stepwise.",
)
@pytest.hookimpl
def pytest_configure(config: Config) -> None:
# We should always have a cache as cache provider plugin uses tryfirst=True
if config.option.stepwise_skip:
# allow --stepwise-skip to work on it's own merits.
config.option.stepwise = True
if config.getoption("stepwise"):
config.pluginmanager.register(StepwisePlugin(config), "stepwiseplugin")