From 64f6547aefcd6ac9024c751015bfa77317f869fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 29 Jul 2025 16:40:55 +0200 Subject: [PATCH] [scripts/run_tests] use 'TestResult.wasSuccessful()' --- scripts/run_tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run_tests.py b/scripts/run_tests.py index d1fd1f14..ebf06fa8 100755 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -34,13 +34,13 @@ suite = unittest.TestSuite() for test in TESTS: try: module = __import__(test) - except ImportError: - print("unable to import", test) + except Exception as exc: + sys.stderr.write(f"Failed to import {test}: {exc}\n") else: tests = unittest.defaultTestLoader.loadTestsFromModule(module) suite.addTests(tests) if __name__ == "__main__": result = unittest.TextTestRunner(verbosity=2).run(suite) - if result.errors or result.failures: + if not result.wasSuccessful(): sys.exit(1)