Skip to content

Commit fd309f5

Browse files
committed
raise an exception if any tests fail instead of returning the result
1 parent 0acc47a commit fd309f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pythonnet/src/tests/runtests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ def main(verbosity=1):
6262
module = __import__(name)
6363
suite.addTests((module.test_suite(),))
6464

65-
return unittest.TextTestRunner(verbosity=verbosity).run(suite)
65+
result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
66+
if not result.wasSuccessful():
67+
raise Exception("Tests failed")
6668

6769
if __name__ == '__main__':
68-
result = main(1)
70+
main(1)
6971
if '--pause' in sys.argv:
7072
print "Press enter to continue"
7173
raw_input()
72-
sys.exit(result)
7374

0 commit comments

Comments
 (0)