From 7b6a1f76caa57713a6a1ca0bdb9177e3254eaab6 Mon Sep 17 00:00:00 2001 From: Arsenii Shatokhin Date: Wed, 10 Jan 2024 10:50:43 +0400 Subject: [PATCH] Exit tests with 1 on fails --- run_tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/run_tests.py b/run_tests.py index a45c5589..9d7739d1 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,5 +1,6 @@ import unittest import os +import sys if __name__ == '__main__': # Change the current working directory to 'tests' @@ -11,4 +12,8 @@ # Create a test runner that will run the test suite runner = unittest.TextTestRunner() - runner.run(suite) + result = runner.run(suite) + + # Exit with a non-zero exit code if tests failed + if not result.wasSuccessful(): + sys.exit(1)