summaryrefslogtreecommitdiff
path: root/odoo/modules
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/modules')
-rw-r--r--odoo/modules/module.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index 191a45e9e8e..b5a513e19fc 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -357,7 +357,19 @@ def get_test_modules(module):
""" Return a list of module for the addons potentially containing tests to
feed unittest.TestLoader.loadTestsFromModule() """
# Try to import the module
- modpath = 'odoo.addons.' + module
+ results = _get_tests_modules('odoo.addons', module)
+
+ try:
+ importlib.import_module('odoo.upgrade.%s' % module)
+ except ImportError:
+ pass
+ else:
+ results += _get_tests_modules('odoo.upgrade', module)
+
+ return results
+
+def _get_tests_modules(path, module):
+ modpath = '%s.%s' % (path, module)
try:
mod = importlib.import_module('.tests', modpath)
except ImportError as e: # will also catch subclass ModuleNotFoundError of P3.6