pytest-dev / pytest-dev/pytest

documentation contradiction: pytest_load_initial_conftests

Open
#4,482 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: docs
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

I think there is a contradiction between this example page in the documentation and the reference of pytest_load_initial_conftests.

https://docs.pytest.org/en/latest/example/simple.html#dynamically-adding-command-line-options
https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_load_initial_conftests

The examples page suggests that it can be used to " dynamically modify the command line arguments ". But the reference says This hook will not be called for conftest.py files, only for setuptools plugins.

The examples page doesn't mention anything about setuptools plugins and it gives the impression that it can be used from conftest files, like other examples from the same page.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the dynamically-adding-command-line-options example in example/simple.html with the pytest_load_initial_conftests reference in reference.html. Verify the hook's documented scope, then align the two pages so the example clearly states the applicable plugin context and no longer contradicts the reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, testing-qa
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.