Skip to content

Commit 912f941

Browse files
belyalovdpgeorge
authored andcommitted
unittest: Exit with non zero code in case of failures. Fixing micropython#259
1 parent 0a581ef commit 912f941

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unittest/unittest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import sys
2+
3+
14
class SkipTest(Exception):
25
pass
36

@@ -217,3 +220,5 @@ def test_cases(m):
217220
suite.addTest(c)
218221
runner = TestRunner()
219222
result = runner.run(suite)
223+
# Terminate with non zero return code in case of failures
224+
sys.exit(result.failuresNum > 0)

0 commit comments

Comments
 (0)