Unit test script returns exit code = 0 even if tests fail
The code is not using unittest.main. You need to check the result using TestResult.wasSuccessful and call sys.exit manually. import sys …. ret = not runner.run(suite).wasSuccessful() sys.exit(ret)