pytest-rerunfailures icon indicating copy to clipboard operation
pytest-rerunfailures copied to clipboard

[RFC] `--reruns-on-exitfirst`: set reruns with `--exitfirst` / `-x`

Open tony opened this issue 1 year ago • 0 comments

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

tony avatar Feb 15 '24 18:02 tony