[IMP] use TestSuite.addTests instead of manually iterating on loadTestsFromModule results

bzr revid: xmo@openerp.com-20140214145257-2alo4dvn8rmq3xfj
This commit is contained in:
Xavier Morel
2014-02-14 15:52:57 +01:00
parent d21114454e
commit a86d7a548d
+3 -3
View File
@@ -360,9 +360,9 @@ def run_unit_tests(module_name, dbname):
r = True
for m in mods:
suite = unittest2.TestSuite()
for t in unittest2.TestLoader().loadTestsFromModule(m):
suite.addTest(t)
_logger.log(logging.INFO, 'module %s: running test %s.', module_name, m.__name__)
suite.addTests(unittest2.TestLoader().loadTestsFromModule(m))
_logger.info('module %s: running test %s.', module_name, m.__name__)
result = unittest2.TextTestRunner(verbosity=2, stream=TestStream()).run(suite)
if not result.wasSuccessful():
r = False