Skip to content

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

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

Activity

added 2 commits that reference this issue on Mar 20, 2025
14e083f
072bd1e
added
type: bugproblem that needs to be addressed
plugin: pytesterrelated to the pytester builtin plugin
on Mar 21, 2025
added a commit that references this issue on Apr 1, 2025
b3b26d1
nicoddemus

nicoddemus commented on Jul 14, 2025

@nicoddemus
Member

Fixed by #13522.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @nicoddemus@Zac-HD@Faboor

      Issue actions

        Pytester.runpytest_subprocess only adds the first plugin from pytester.plugins · Issue #13314 · pytest-dev/pytest