Deprecate looponfail plugin

Fix #826
This commit is contained in:
Bruno Oliveira
2022-10-22 10:24:20 -03:00
parent f2064873fd
commit 8b0856a986
5 changed files with 19 additions and 6 deletions

View File

@@ -1,7 +1,6 @@
import os
import uuid
import sys
from pathlib import Path
import pytest
@@ -158,8 +157,7 @@ def pytest_addoption(parser):
parser.addini(
"looponfailroots",
type="paths" if PYTEST_GTE_7 else "pathlist",
help="directories to check for changes",
default=[Path.cwd()],
help="directories to check for changes. Default: current directory.",
)
@@ -191,6 +189,13 @@ def pytest_configure(config):
if tr:
tr.showfspath = False
if config.getoption("looponfail", None) or config.getini("looponfailroots"):
warning = DeprecationWarning(
"The --looponfail command line argument and looponfailroots config variable are deprecated.\n"
"The loop-on-fail feature will be removed in pytest-xdist 4.0."
)
config.issue_config_time_warning(warning, 2)
config_line = (
"xdist_group: specify group for tests should run in same session."
"in relation to one another. " + "Provided by pytest-xdist."