Skip to content

Clarify conftest hook timing before collection#14563

Open
CortexShadow wants to merge 1 commit into
pytest-dev:mainfrom
CortexShadow:fix-report-header-conftest-docs-14557
Open

Clarify conftest hook timing before collection#14563
CortexShadow wants to merge 1 commit into
pytest-dev:mainfrom
CortexShadow:fix-report-header-conftest-docs-14557

Conversation

@CortexShadow
Copy link
Copy Markdown
Contributor

@CortexShadow CortexShadow commented Jun 6, 2026

Summary

Clarify that only initial conftest files are available for hooks which run before collection, such as pytest_sessionstart and pytest_report_header.

This addresses the confusing case where a deeper conftest can still receive later/historic hooks like pytest_configure, but cannot affect the terminal header once pytest_report_header has already run.

Closes #14557.

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 6, 2026
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.

pytest_report_header from conftest.py not collected, in contradiction with documented behavior

1 participant