Skip to content

Commit 0c49e80

Browse files
committed
Make tests return non-zero status on failures, and increase verbosity
1 parent a9ce7fe commit 0c49e80

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎tests/module_test_runner.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def RunAllTests(self):
4141
It also sets any module variables which match the settings keys to the
4242
corresponding values in the settings member.
4343
"""
44-
runner = unittest.TextTestRunner()
44+
runner = unittest.TextTestRunner(verbosity=2)
4545
for module in self.modules:
4646
# Set any module variables according to the contents in the settings
4747
for setting, value in self.settings.iteritems():
@@ -53,5 +53,6 @@ def RunAllTests(self):
5353
pass
5454
# We have set all of the applicable settings for the module, now
5555
# run the tests.
56-
print '\nRunning all tests in module', module.__name__
57-
runner.run(unittest.defaultTestLoader.loadTestsFromModule(module))
56+
result = runner.run(unittest.defaultTestLoader.loadTestsFromModule(module))
57+
if not result.wasSuccessful():
58+
raise Exception('Tests failed!')

0 commit comments

Comments
 (0)