From 0777e91d528b357d5218c27521845c7dbbddb39c Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Thu, 4 Jul 2019 13:11:03 +0300 Subject: [PATCH] Fail if number of excuted tests != number of dicovered tests this will report failing status in CI in case we have the 'Ran 0 tests in 46.486s' scenario. Note: the check is placed after runner.run() to present the message shown above which should make it more clear what went on. Related: rhbz#1698366 0 run --- test/composertest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/composertest.py b/test/composertest.py index c837948b..739e9750 100755 --- a/test/composertest.py +++ b/test/composertest.py @@ -132,4 +132,8 @@ def main(): runner = unittest.TextTestRunner(verbosity=2, failfast=args.sit) result = runner.run(tests) + if tests.countTestCases() != result.testsRun: + print("Error: unexpected number of tests were run", file=sys.stderr) + sys.exit(1) + sys.exit(not result.wasSuccessful())