From 9aa1ecbe58b41d482d4a30be3082f4db0d351db7 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 1 Dec 2011 16:31:56 +0100 Subject: [IMP] indicate tests in current thread, and prevent email sending during tests bzr revid: rco@openerp.com-20111201153156-2ki7x22evf5ojyrz --- openerp/modules/loading.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'openerp/modules/loading.py') diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index 00948bc690e..1ea0bdb7105 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -31,6 +31,7 @@ import logging import os import re import sys +import threading import zipfile import zipimport @@ -97,11 +98,13 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= cr.commit() if not tools.config.options['test_disable']: try: + threading.currentThread().testing = True _load_data(cr, module_name, idref, mode, 'test') except Exception, e: logging.getLogger('init.test').exception( 'Tests failed to execute in module %s', module_name) finally: + threading.currentThread().testing = False if tools.config.options['test_commit']: cr.commit() else: -- cgit v1.2.3