Skip to content

Pytester.runpytest_subprocess only adds the first plugin from pytester.plugins #13314

Open
@Faboor

Description

@Faboor

When adding multiple plugins to pytester.plugins only the first one is added as a -p <plugin> to the command line invocation in pytester.runpytest_subprocess().

Minimal example:

# Content of test_minimal.py:

def test_pytester_minimal(pytester):
    pytester.plugins.extend(["no:plug_1", "no:plug_2"])
    pytester.runpytest_subprocess()
$ pytest --version
pytest 8.3.5

$ pytest -p pytester -rP test_minimal.py
...
__________ test_pytester_minimal __________
---------- Captured stdout call ----------
running: /Users/Faboor/Projects/pytester/venv/bin/python3.12 -mpytest -p no:plug_1 --basetemp=/private/var/folders/q0/x7bql_wd1f9gw5y8rb15tg240000gq/T/pytest-of-Faboor/pytest-5/test_pytester_minimal0/runpytest-0
...

Notice that only -p no:plug_1 is added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: pytesterrelated to the pytester builtin plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions