Deprecate --boxed

This will allow removing the pytest-forked dependency in the future.

Refs #468.
This commit is contained in:
Ran Benita 2021-11-02 09:00:24 +02:00
parent 18cd9b900c
commit 89a3df3e20
4 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1,3 @@
The ``--boxed`` commmand line argument is deprecated.
Install pytest-forked and use ``--forked`` instead.
pytest-xdist 3.0.0 will remove the ``--boxed`` argument and pytest-forked dependency.

View File

@ -1,9 +1,9 @@
.. note::
.. warning::
Since 1.19.0, the actual implementation of the ``--boxed`` option has been moved to a
separate plugin, `pytest-forked <https://github.com/pytest-dev/pytest-forked>`_
which can be installed independently. The ``--boxed`` command-line options remains
for backward compatibility reasons.
which can be installed independently. The ``--boxed`` command-line option is deprecated
and will be removed in pytest-xdist 3.0.0; use ``--forked`` from pytest-forked instead.
If your testing involves C or C++ libraries you might have to deal

View File

@ -193,6 +193,12 @@ def pytest_configure(config):
if tr:
tr.showfspath = False
if config.getoption("boxed"):
warning = DeprecationWarning(
"The --boxed commmand line argument is deprecated. "
"Install pytest-forked and use --forked instead. "
"pytest-xdist 3.0.0 will remove the --boxed argument and pytest-forked dependency."
)
config.issue_config_time_warning(warning, 2)
config.option.forked = True

View File

@ -738,7 +738,7 @@ def test_tmpdir_disabled(pytester: pytest.Pytester) -> None:
result.stdout.fnmatch_lines("*1 passed*")
@pytest.mark.parametrize("plugin", ["xdist.looponfail", "xdist.boxed"])
@pytest.mark.parametrize("plugin", ["xdist.looponfail"])
def test_sub_plugins_disabled(pytester, plugin) -> None:
"""Test that xdist doesn't break if we disable any of its sub-plugins. (#32)"""
p1 = pytester.makepyfile(