pytest how to exit only on error not on failure
12:29 24 Apr 2023

Similar to this question, except desiring to exit only on errors encountered, not on failures.

In theory, this would be useful because:

  • A "failed" test indicates something wrong with that test, however there should be no impact to other tests, and so the test suite continuing to execute would be valid.
  • An "error" test indicates something is wrong with the testbed/setup/config, so the test suite continuing to run would be a waste of time.

I surmise there would be elaborate ways to get this accomplished with decorators and pytest.mark, but looking for a clean, simple solution that would avoid that if possible.

python unit-testing pytest