It looks like a negative rerun count can cause a collected test not to run, while pytest exits successfully.
For example, running pytest --reruns=-1 with:
def test_should_run():
assert False
collects one test, but does not report a test result and exits with code 0.
The same happens with negative values from:
reruns = -1
@pytest.mark.flaky(reruns=-1)
--force-reruns=-1
--reruns=0 works as expected here.
Negative rerun counts should probably be rejected as invalid configuration instead of allowing the test session to succeed without running the test.
If this looks worth fixing, I'd be happy to work on it.
It looks like a negative rerun count can cause a collected test not to run, while pytest exits successfully.
For example, running
pytest --reruns=-1with:collects one test, but does not report a test result and exits with code 0.
The same happens with negative values from:
reruns = -1@pytest.mark.flaky(reruns=-1)--force-reruns=-1--reruns=0works as expected here.Negative rerun counts should probably be rejected as invalid configuration instead of allowing the test session to succeed without running the test.
If this looks worth fixing, I'd be happy to work on it.