Merge pull request #821 from nicoddemus/drop-forked
Remove --boxed and pytest-forked dependency
This commit is contained in:
@@ -4,7 +4,7 @@ pytest-xdist 2.5.0 (2021-12-10)
|
|||||||
Deprecations and Removals
|
Deprecations and Removals
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
- `#468 <https://github.com/pytest-dev/pytest-xdist/issues/468>`_: The ``--boxed`` command 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.
|
- `#468 <https://github.com/pytest-dev/pytest-xdist/issues/468>`_: The ``--boxed`` command line argument is deprecated. Install `pytest-forked <https://pypi.org/project/pytest-forked>`__ and use ``--forked`` instead. pytest-xdist 3.0.0 will remove the ``--boxed`` argument and ``pytest-forked`` dependency.
|
||||||
|
|
||||||
|
|
||||||
Features
|
Features
|
||||||
|
|||||||
1
changelog/468.removal.rst
Normal file
1
changelog/468.removal.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
The ``--boxed`` command-line option has been removed. If you still need this functionality, install `pytest-forked <https://pypi.org/project/pytest-forked>`__ separately.
|
||||||
1
changelog/468.trivial.rst
Normal file
1
changelog/468.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
The ``py`` dependency has been dropped.
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
.. _boxed:
|
|
||||||
|
|
||||||
Running tests in a boxed subprocess (moved to pytest-forked)
|
|
||||||
============================================================
|
|
||||||
|
|
||||||
This functionality has been moved to the
|
|
||||||
`pytest-forked <https://github.com/pytest-dev/pytest-forked>`_ plugin, but the ``--boxed`` option
|
|
||||||
is still kept for backward compatibility.
|
|
||||||
@@ -55,7 +55,6 @@ Features
|
|||||||
|
|
||||||
distribution
|
distribution
|
||||||
subprocess
|
subprocess
|
||||||
boxed
|
|
||||||
remote
|
remote
|
||||||
crash
|
crash
|
||||||
how-to
|
how-to
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ python_requires = >=3.6
|
|||||||
install_requires =
|
install_requires =
|
||||||
execnet>=1.1
|
execnet>=1.1
|
||||||
pytest>=6.2.0
|
pytest>=6.2.0
|
||||||
pytest-forked
|
|
||||||
setup_requires = # left empty, enforce using isolated build system
|
setup_requires = # left empty, enforce using isolated build system
|
||||||
|
|
||||||
[options.packages.find]
|
[options.packages.find]
|
||||||
|
|||||||
@@ -134,11 +134,6 @@ def pytest_addoption(parser):
|
|||||||
metavar="GLOB",
|
metavar="GLOB",
|
||||||
help="add expression for ignores when rsyncing to remote tx nodes.",
|
help="add expression for ignores when rsyncing to remote tx nodes.",
|
||||||
)
|
)
|
||||||
group.addoption(
|
|
||||||
"--boxed",
|
|
||||||
action="store_true",
|
|
||||||
help="backward compatibility alias for pytest-forked --forked",
|
|
||||||
)
|
|
||||||
group.addoption(
|
group.addoption(
|
||||||
"--testrunuid",
|
"--testrunuid",
|
||||||
action="store",
|
action="store",
|
||||||
@@ -195,14 +190,6 @@ def pytest_configure(config):
|
|||||||
tr = config.pluginmanager.getplugin("terminalreporter")
|
tr = config.pluginmanager.getplugin("terminalreporter")
|
||||||
if tr:
|
if tr:
|
||||||
tr.showfspath = False
|
tr.showfspath = False
|
||||||
if config.getoption("boxed"):
|
|
||||||
warning = DeprecationWarning(
|
|
||||||
"The --boxed command 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
|
|
||||||
|
|
||||||
config_line = (
|
config_line = (
|
||||||
"xdist_group: specify group for tests should run in same session."
|
"xdist_group: specify group for tests should run in same session."
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import uuid
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Union, Sequence, Optional, Any, Tuple, Set
|
from typing import List, Union, Sequence, Optional, Any, Tuple, Set
|
||||||
|
|
||||||
import py
|
|
||||||
import pytest
|
import pytest
|
||||||
import execnet
|
import execnet
|
||||||
|
|
||||||
|
|||||||
@@ -602,11 +602,10 @@ def test_config_initialization(
|
|||||||
def test_crashing_item(pytester, when) -> None:
|
def test_crashing_item(pytester, when) -> None:
|
||||||
"""Ensure crashing item is correctly reported during all testing stages"""
|
"""Ensure crashing item is correctly reported during all testing stages"""
|
||||||
code = dict(setup="", call="", teardown="")
|
code = dict(setup="", call="", teardown="")
|
||||||
code[when] = "py.process.kill(os.getpid())"
|
code[when] = "os._exit(1)"
|
||||||
p = pytester.makepyfile(
|
p = pytester.makepyfile(
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import py
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@@ -122,22 +122,6 @@ def test_hook_auto_num_workers(
|
|||||||
assert config.getoption("numprocesses") == 42
|
assert config.getoption("numprocesses") == 42
|
||||||
|
|
||||||
|
|
||||||
def test_boxed_with_collect_only(pytester: pytest.Pytester) -> None:
|
|
||||||
from xdist.plugin import pytest_cmdline_main as check_options
|
|
||||||
|
|
||||||
config = pytester.parseconfigure("-n1", "--boxed")
|
|
||||||
check_options(config)
|
|
||||||
assert config.option.forked
|
|
||||||
|
|
||||||
config = pytester.parseconfigure("-n1", "--collect-only")
|
|
||||||
check_options(config)
|
|
||||||
assert not config.option.forked
|
|
||||||
|
|
||||||
config = pytester.parseconfigure("-n1", "--boxed", "--collect-only")
|
|
||||||
check_options(config)
|
|
||||||
assert config.option.forked
|
|
||||||
|
|
||||||
|
|
||||||
def test_dsession_with_collect_only(pytester: pytest.Pytester) -> None:
|
def test_dsession_with_collect_only(pytester: pytest.Pytester) -> None:
|
||||||
from xdist.plugin import pytest_cmdline_main as check_options
|
from xdist.plugin import pytest_cmdline_main as check_options
|
||||||
from xdist.plugin import pytest_configure as configure
|
from xdist.plugin import pytest_configure as configure
|
||||||
|
|||||||
Reference in New Issue
Block a user