I am using pytest
, and the test execution is supposed to run until it encounters an exception. If the test never encounters an exception it should continue running for the rest of time or until I send it a SIGINT/SIGTERM.
Is there a programmatic way to tell pytest
to stop running on the first failure as opposed to having to do this at the command line?
pytest -x # stop after first failure
pytest --maxfail=2 # stop after two failures
See the documentation at http://pytest.org/en/latest/usage.html