Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Faboor opened this issue Mar 20, 2025 · 0 comments · May be fixed by #13316
Open

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

Faboor opened this issue Mar 20, 2025 · 0 comments · May be fixed by #13316
Labels
plugin: pytester related to the pytester builtin plugin type: bug problem that needs to be addressed

Comments

@Faboor
Copy link

Faboor commented Mar 20, 2025

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.

Faboor added a commit to Faboor/pytest that referenced this issue Mar 20, 2025
Faboor added a commit to Faboor/pytest that referenced this issue Mar 20, 2025
@Faboor Faboor linked a pull request Mar 20, 2025 that will close this issue
6 tasks
@Zac-HD Zac-HD added type: bug problem that needs to be addressed plugin: pytester related to the pytester builtin plugin labels Mar 21, 2025
Faboor added a commit to Faboor/pytest that referenced this issue Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: pytester related to the pytester builtin plugin type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants