Skip to content

doc: fix pytest_load_initial_conftests example referring to conftest.py#14686

Open
PranavAchar01 wants to merge 1 commit into
pytest-dev:mainfrom
PranavAchar01:doc/4482-load-initial-conftests-example
Open

doc: fix pytest_load_initial_conftests example referring to conftest.py#14686
PranavAchar01 wants to merge 1 commit into
pytest-dev:mainfrom
PranavAchar01:doc/4482-load-initial-conftests-example

Conversation

@PranavAchar01

Copy link
Copy Markdown

Closes #4482.

The "Dynamically adding command line options" example in doc/en/example/simple.rst defines pytest_load_initial_conftests under a # installable external plugin comment, but the following prose referred to it as "the above conftest.py". That contradicts the hook reference in _pytest/hookspec.py, which states:

This hook is not called for conftest files.

@RonnyPfannschmidt confirmed in the issue that this is "indeed a mistake". This changes the wording to "the above plugin" so the example is consistent with the hook's documented behavior (it only runs from an installable plugin, not a project conftest.py).

Docs-only change; added a changelog/4482.doc.rst entry.

This documentation fix was prepared with the assistance of Claude Code and verified against the hook reference and the issue.

The 'Dynamically adding command line options' example defines
pytest_load_initial_conftests under a '# installable external plugin' comment
but the following prose called it 'the above conftest.py'. This contradicts the
hook reference, which states the hook is not called for conftest files. Refer to
it as a plugin instead.

Closes pytest-dev#4482
Copilot AI review requested due to automatic review settings July 7, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

documentation contradiction: pytest_load_initial_conftests

2 participants