diff --git a/odoo/service/server.py b/odoo/service/server.py index f95fd020928..cffb6cd4373 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -1155,9 +1155,9 @@ def load_test_file_py(registry, test_file): for mod_mod in get_test_modules(mod): mod_path, _ = os.path.splitext(getattr(mod_mod, '__file__', '')) if test_path == mod_path: - suite = OdooSuite() - for t in unittest.TestLoader().loadTestsFromModule(mod_mod): - suite.addTest(t) + tests = odoo.modules.module.unwrap_suite( + unittest.TestLoader().loadTestsFromModule(mod_mod)) + suite = OdooSuite(tests) _logger.log(logging.INFO, 'running tests %s.', mod_mod.__name__) result = odoo.modules.module.OdooTestRunner().run(suite) success = result.wasSuccessful() diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 8fbf8400a0c..f6eec4d2a9a 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -134,7 +134,7 @@ class OdooSuite(unittest.suite.TestSuite): if sys.version_info < (3, 8): # Partial backport of bpo-24412, merged in CPython 3.8 - def _handleClassSetup(self, test, result): + def _handleClassSetUp(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: