Skip to content

Plugins loaded via pytest_plugins global variable are not reported #12645

Closed
@chbndrhnns

Description

@chbndrhnns

When adding a pytest plugin to conftest.py's pytest_plugins symbol, this plugin is not reported:

  • when running pytest --setup-plan
  • when running pytest --version --version.
    (Is this supposed to report the same plugins?

Environment:

  • Python 3.12
  • pytest 8.3.1

MWE:

# tests/conftest.py
pytest_plugins = [
    "tests.myplugin"
]

# tests/myplugin.py
import pytest


@pytest.fixture
def myfixture():
    return 42

# tests/test_.py
def test_(myfixture):
    assert True

Output of pytest --setup-plan

pytest --setup-plan
========================================================================================================== test session starts ===========================================================================================================
platform darwin -- Python 3.12.0, pytest-8.3.1, pluggy-1.5.0
rootdir: /Users/x/src/y
configfile: pyproject.toml
collected 1 item                                                                                                                                                                                                                         

tests/test_.py 
        SETUP    F myfixture
        tests/test_.py::test_ (fixtures used: myfixture)
        TEARDOWN F myfixture

========================================================================================================= no tests ran in 0.00s ==========================================================================================================

I consider this a related issue: #12615

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions