Updating runner to exit 1 on failure

This commit is contained in:
Brian O'Connor
2017-01-12 15:33:29 -08:00
parent 03b1cbb347
commit 9376ccbedd
+2 -1
View File
@@ -21,7 +21,8 @@ def runTests( testDir, verbosity=1 ):
# discover all tests in testDir
testSuite = defaultTestLoader.discover( testDir )
# run tests
TextTestRunner( verbosity=verbosity ).run( testSuite )
success = TextTestRunner( verbosity=verbosity ).run( testSuite ).wasSuccessful()
sys.exit( 0 if success else 1 )
if __name__ == '__main__':
setLogLevel( 'warning' )