pytest-dev / pytest-dev/pytest-rerunfailures
[RFC] `--reruns-on-exitfirst`: set reruns with `--exitfirst` / `-x`
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 477
- Forks
- 107
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 21
Description
Assume pyproject.toml:
[tool.pytest.ini_options]
addopts = "--reruns 2"
Current behavior
Right now, passing --exitfirst / -x will rerun twice.
Better: --reruns-on-exitfirst 0
This way, the user can set the reruns with exitfirst is used so it instantly errors. It preserves the default behavior.
--exitfirst's docs:
-x, --exitfirst Exit instantly on first error or failed test
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 by locating the plugin's option definitions and the handling for pytest's --exitfirst/-x flag. Check how addopts from pyproject.toml supplies --reruns, then verify that the new setting defaults to 0, overrides reruns when exitfirst is used, and preserves the current behavior otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100