##// END OF EJS Templates
tests: add a test runner utility that prints nothing when all tests pass...
Idan Kamara -
r18665:2cbfb8c4 default
parent child Browse files
Show More
@@ -0,0 +1,18 b''
1 import unittest, sys
2
3 def main(modulename):
4 '''run the tests found in module, printing nothing when all tests pass'''
5 module = sys.modules[modulename]
6 suite = unittest.defaultTestLoader.loadTestsFromModule(module)
7 results = unittest.TestResult()
8 suite.run(results)
9 if results.errors or results.failures:
10 for tc, exc in results.errors:
11 print 'ERROR:', tc
12 print
13 sys.stdout.write(exc)
14 for tc, exc in results.failures:
15 print 'FAIL:', tc
16 print
17 sys.stdout.write(exc)
18 sys.exit(1)
General Comments 0
You need to be logged in to leave comments. Login now