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
This commit is contained in:
parent
9bce583fc2
commit
0777e91d52
@ -132,4 +132,8 @@ def main():
|
|||||||
runner = unittest.TextTestRunner(verbosity=2, failfast=args.sit)
|
runner = unittest.TextTestRunner(verbosity=2, failfast=args.sit)
|
||||||
result = runner.run(tests)
|
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())
|
sys.exit(not result.wasSuccessful())
|
||||||
|
Loading…
Reference in New Issue
Block a user