pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Fix 13314 add all plugins to pytester subprocess

Open Faboor opened this issue 8 months ago • 0 comments

Closes #13314

  • [X] Not Applicable: Include documentation when adding new features.
  • [X] Include new tests or update existing tests when applicable.
  • [X] Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.
  • [x] Add text like closes #XYZW to the PR description and/or commits (where XYZW is the issue number). See the github docs for more information.
  • [X] Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.
  • [X] Add yourself to AUTHORS in alphabetical order.

Running the same minimal example from #13314:

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

Testing

Running the new test without 072bd1e14fe0e3b7841e486cb89514209e707464 using pytest -v testing/test_pytester.py::test_pytester_subprocess_with_plugins

=================================== FAILURES ===================================
_________________________________ test_plugins _________________________________

pytestconfig = <_pytest.config.Config object at 0x1071bce60>

    def test_plugins(pytestconfig):
        plugins = pytestconfig.pluginmanager.list_name_plugin()
        assert ("plug_1", None) in plugins
>       assert ("plug_2", None) in plugins
E       AssertionError: assert ('plug_2', None) in [('4402264160', <_pytest.config.PytestPluginManager object at 0x106653860>), ('pytestconfig', <_pytest.config.Config o...init__.py'>), ('main', <module '_pytest.main' from '/Users/Faboor/Projects/pytester/pytest/src/_pytest/main.py'>), ...]

test_pytester_subprocess_with_plugins.py:4: AssertionError
=========================== short test summary info ============================
FAILED test_pytester_subprocess_with_plugins.py::test_plugins - AssertionErro...
============================== 1 failed in 0.06s ===============================

and with the change:

testing/test_pytester.py::test_pytester_subprocess_with_plugins PASSED   [100%]

=================================== 1 passed in 0.47s =================================== 

Faboor avatar Mar 20 '25 11:03 Faboor