Skip to content

Commit

Permalink
back to standard unit test reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
lepistone committed Jan 13, 2016
1 parent 4a46dbb commit a12327e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
5 changes: 0 additions & 5 deletions openerp/modules/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,6 @@ def load_modules(db, force_demo=False, status=None, update_module=False):

t0 = time.time()
t0_sql = openerp.sql_db.sql_counter
if openerp.tools.config['test_enable']:
cr.execute("SELECT name FROM ir_module_module WHERE state='installed'")
for module_name in cr.fetchall():
report.record_result(openerp.modules.module.run_unit_tests(module_name[0], cr.dbname, position=runs_post_install))
_logger.log(25, "All post-tested in %.2fs, %s queries", time.time() - t0, openerp.sql_db.sql_counter - t0_sql)
finally:
cr.close()

Expand Down
7 changes: 1 addition & 6 deletions openerp/modules/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,7 @@ def run_unit_tests(module_name, dbname, position=runs_at_install):
t0 = time.time()
t0_sql = openerp.sql_db.sql_counter
_logger.info('%s running tests.', m.__name__)
result = unittest2.TextTestRunner(verbosity=2, stream=TestStream(m.__name__)).run(suite)
if time.time() - t0 > 5:
_logger.log(25, "%s tested in %.2fs, %s queries", m.__name__, time.time() - t0, openerp.sql_db.sql_counter - t0_sql)
if not result.wasSuccessful():
r = False
_logger.error("Module %s: %d failures, %d errors", module_name, len(result.failures), len(result.errors))
result = unittest2.TextTestRunner(verbosity=2).run(suite)

current_test = None
threading.currentThread().testing = False
Expand Down

0 comments on commit a12327e

Please sign in to comment.