From 89a3df3e2075a014afeed56a3e84871394956294 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 2 Nov 2021 09:00:24 +0200 Subject: [PATCH] Deprecate --boxed This will allow removing the pytest-forked dependency in the future. Refs #468. --- changelog/468.deprecation.rst | 3 +++ example/boxed.txt | 6 +++--- src/xdist/plugin.py | 6 ++++++ testing/acceptance_test.py | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 changelog/468.deprecation.rst diff --git a/changelog/468.deprecation.rst b/changelog/468.deprecation.rst new file mode 100644 index 0000000..e3109c9 --- /dev/null +++ b/changelog/468.deprecation.rst @@ -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. diff --git a/example/boxed.txt b/example/boxed.txt index aabb27e..81543ab 100644 --- a/example/boxed.txt +++ b/example/boxed.txt @@ -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 `_ - 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 diff --git a/src/xdist/plugin.py b/src/xdist/plugin.py index e65bb4a..5f1ed09 100644 --- a/src/xdist/plugin.py +++ b/src/xdist/plugin.py @@ -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 diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 3280aa1..b7dadf8 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -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(