pytest-dev / pytest-dev/pytest
pytest_load_initial_conftests not called for conftest plugins (arg manipulation)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
Hi! I'm trying to find a way to use doctests, but not for Windows. It seems that there's a way to do this at: https://docs.pytest.org/en/latest/example/simple.html#dynamically-adding-command-line-options
I tried the following minimal example but it did not work:
import platform
def pytest_load_initial_conftests(args):
if platform.system() != 'Windows':
args[:] = args + ['--doctest-modules']
Is there something I'm missing here?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documentation example for dynamically adding command-line options and trace how pytest_load_initial_conftests is discovered for conftest plugins. Reproduce the minimal example on a non-Windows system, then inspect the relevant hook-loading behavior. Done means the hook can add --doctest-modules as shown, with coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100