summaryrefslogtreecommitdiff
path: root/openerp/modules/module.py
diff options
context:
space:
mode:
authorSamus CTO <cto@openerp.com>2015-01-16 11:57:23 +0100
committerSamus CTO <cto@openerp.com>2015-01-28 16:17:43 +0100
commit7126ae81438fd1476f0fca1ff4dfd8d6f3356389 (patch)
treeae7711fcb36d89bcb1b4c3eeb63732c1228d2d24 /openerp/modules/module.py
parent205143cc32e96166a523e6b3f422c014ba5a8d24 (diff)
[FIX] mail: prevent sending mail during registry loading
Diffstat (limited to 'openerp/modules/module.py')
-rw-r--r--openerp/modules/module.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/openerp/modules/module.py b/openerp/modules/module.py
index f4639ccc886..b9f19293fee 100644
--- a/openerp/modules/module.py
+++ b/openerp/modules/module.py
@@ -31,6 +31,7 @@ import re
import sys
import time
import unittest
+import threading
from os.path import join as opj
import unittest2
@@ -435,6 +436,7 @@ def run_unit_tests(module_name, dbname, position=runs_at_install):
global current_test
current_test = module_name
mods = get_test_modules(module_name)
+ threading.currentThread().testing = True
r = True
for m in mods:
tests = unwrap_suite(unittest2.TestLoader().loadTestsFromModule(m))
@@ -452,6 +454,7 @@ def run_unit_tests(module_name, dbname, position=runs_at_install):
_logger.error("Module %s: %d failures, %d errors", module_name, len(result.failures), len(result.errors))
current_test = None
+ threading.currentThread().testing = False
return r
def unwrap_suite(test):