Python nose framework: How to stop execution upon first failure

PythonUnit Testing

Python Problem Overview


It seems that if a testcase fails, nose will attempt to execute the next testcases. How can I make nose to abort all execution upon the first error in any testcase? I tried sys.exit() but it gave me some ugly and lengthy messages about it

Python Solutions


Solution 1 - Python

There is an option for nose:

-x, --stop
Stop running tests after the first error or failure

Is this what you need?

Following link can help you with all the options available for nosetests. http://nose.readthedocs.org/en/latest/usage.html

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGabiMeView Question on Stackoverflow
Solution 1 - PythongruszczyView Answer on Stackoverflow