Skip to content

Commit cd0a08d

Browse files
authored
[FIX] Get migration tests from module/migration/tests (#2207)
1 parent 22f7c8c commit cd0a08d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

odoo/modules/loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def load_test(idref, mode):
290290

291291
# OpenUpgrade: run tests
292292
if os.environ.get('OPENUPGRADE_TESTS') and package.name is not None:
293-
prefix = '.migrations.%s' % adapt_version(package.data['version'])
293+
prefix = '.migrations'
294294
registry.openupgrade_test_prefixes[package.name] = prefix
295295
report.record_result(odoo.modules.module.run_unit_tests(module_name, openupgrade_prefix=prefix))
296296

odoo/modules/module.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,18 +587,18 @@ def run(self, test):
587587

588588
def run_unit_tests(module_name, position='at_install', openupgrade_prefix=None):
589589
"""
590-
:param openupgrade_prefix: extension to be able to insert '.migrations.<version>' to the path
591-
of test files to be loaded (expecting tests in '<module_name>/migrations/<version>/tests/test_migration.py')
590+
:param openupgrade_prefix: extension to be able to insert '.migrations' to the path
591+
of test files to be loaded (expecting tests in '<module_name>/migrations/tests/test_migration.py')
592592
:returns: ``True`` if all of ``module_name``'s tests succeeded, ``False``
593593
if any of them failed.
594594
:rtype: bool
595595
"""
596596
global current_test
597-
from odoo.tests.common import TagsSelector # Avoid import loop
597+
from odoo.tests.common import TagsSelector # Avoid import loop
598598
current_test = module_name
599599
mods = get_test_modules(module_name, openupgrade_prefix=openupgrade_prefix)
600600
threading.currentThread().testing = True
601-
config_tags = TagsSelector(tools.config['test_tags'])
601+
config_tags = TagsSelector(tools.config['test_tags'] or '')
602602
position_tag = TagsSelector(position)
603603
r = True
604604
for m in mods:

0 commit comments

Comments
 (0)