Skip to content

fixtures: change --fixtures/--fixtures-per-test to call pytest_collection hook instead of collecting directly - #15050

Open
bluetech wants to merge 1 commit into
pytest-dev:mainfrom
bluetech:showfixture-collection-hook
Open

bluetech wants to merge 1 commit into
pytest-dev:mainfrom
bluetech:showfixture-collection-hook

Conversation

@bluetech

Copy link
Copy Markdown
Member

Fix #15049.

…ollection` hook instead of collecting directly

I don't see a reason for these two commands to bypass the regular
collection. If plugins do things with the hook on a regular run, they
should do it for these two modes as well, just as they do with
`--collect-only`.
@bluetech bluetech added this to the 10.0 milestone Sep 17, 2026
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Sep 17, 2026
@@ -0,0 +1,2 @@
When :option:`--fixtures` or :option:`--fixtures-per-test` are used, the :hook:`pytest_collection` hook is now called to perform the collection.
Previously, these two modes performed the collection directly, bypassing the hook.

@nicoddemus nicoddemus Sep 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone reading this might wonder "where is the breaking change?", because it is non-obvious. Perhaps mention why this might break something, just to clarify the entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fixtures: --fixtures/--fixtures-per-test don't go through pytest_collection

3 participants