Skip to content

Handle specname hooks in subset callers#695

Open
CodingFeng101 wants to merge 1 commit into
pytest-dev:mainfrom
CodingFeng101:codex/subset-specname
Open

Handle specname hooks in subset callers#695
CodingFeng101 wants to merge 1 commit into
pytest-dev:mainfrom
CodingFeng101:codex/subset-specname

Conversation

@CodingFeng101

Copy link
Copy Markdown

What changed

PluginManager.subset_hook_caller() now builds its exclusion set from the hook implementations registered on the target hook instead of checking whether each plugin has an attribute with the hook name.

Why

A plugin can implement a hook through @hookimpl(specname="..."), so the plugin object does not need to expose an attribute with the hook name. In that case, subset_hook_caller() previously failed to exclude the plugin and the implementation still ran.

Validation

  • PYTHONPATH=src python -m pytest testing\test_pluginmanager.py::test_subset_hook_caller_with_specname testing\test_pluginmanager.py::test_subset_hook_caller -q
  • PYTHONPATH=src python -m pytest testing\test_pluginmanager.py -q
  • PYTHONPATH=src python -m pytest -q
  • uv run pytest -q
  • uv run pre-commit run -a

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

Successfully merging this pull request may close these issues.

1 participant