Skip to content

Plugins loaded via pytest_plugins global variable are not reported #12645

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

Closed
chbndrhnns opened this issue Jul 22, 2024 · 2 comments
Closed

Plugins loaded via pytest_plugins global variable are not reported #12645

chbndrhnns opened this issue Jul 22, 2024 · 2 comments

Comments

@chbndrhnns
Copy link

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

@mtelka
Copy link

mtelka commented Jul 22, 2024

Actually, this is a duplicate of #12615. The root cause is same and the same code path is used.

@chbndrhnns
Copy link
Author

chbndrhnns commented Jul 22, 2024

Thank you, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants