Merge pull request #821 from nicoddemus/drop-forked

Remove --boxed and pytest-forked dependency
This commit is contained in:
Bruno Oliveira
2022-10-22 10:04:40 -03:00
committed by GitHub
10 changed files with 4 additions and 44 deletions

View File

@@ -4,7 +4,7 @@ pytest-xdist 2.5.0 (2021-12-10)
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

View 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.

View File

@@ -0,0 +1 @@
The ``py`` dependency has been dropped.

View File

@@ -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.

View File

@@ -55,7 +55,6 @@ Features
distribution
subprocess
boxed
remote
crash
how-to

View File

@@ -44,7 +44,6 @@ python_requires = >=3.6
install_requires =
execnet>=1.1
pytest>=6.2.0
pytest-forked
setup_requires = # left empty, enforce using isolated build system
[options.packages.find]

View File

@@ -134,11 +134,6 @@ def pytest_addoption(parser):
metavar="GLOB",
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(
"--testrunuid",
action="store",
@@ -195,14 +190,6 @@ def pytest_configure(config):
tr = config.pluginmanager.getplugin("terminalreporter")
if tr:
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 = (
"xdist_group: specify group for tests should run in same session."

View File

@@ -6,7 +6,6 @@ import uuid
from pathlib import Path
from typing import List, Union, Sequence, Optional, Any, Tuple, Set
import py
import pytest
import execnet

View File

@@ -602,11 +602,10 @@ def test_config_initialization(
def test_crashing_item(pytester, when) -> None:
"""Ensure crashing item is correctly reported during all testing stages"""
code = dict(setup="", call="", teardown="")
code[when] = "py.process.kill(os.getpid())"
code[when] = "os._exit(1)"
p = pytester.makepyfile(
"""
import os
import py
import pytest
@pytest.fixture

View File

@@ -122,22 +122,6 @@ def test_hook_auto_num_workers(
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:
from xdist.plugin import pytest_cmdline_main as check_options
from xdist.plugin import pytest_configure as configure