diff --git a/setup.py b/setup.py index ccb3beac4d..83edcaa12f 100755 --- a/setup.py +++ b/setup.py @@ -138,6 +138,7 @@ setup(name=name, install_requires=requires, extras_require={ 'BCrypt': ['bcrypt'], + 'test': tests_require, 'html2text': ['html2text'], }, dependency_links=dependency_links, @@ -146,7 +147,4 @@ setup(name=name, [trytond.modules] web_user = trytond.modules.web_user """, - test_suite='tests', - test_loader='trytond.test_loader:Loader', - tests_require=tests_require, ) diff --git a/tests/__init__.py b/tests/__init__.py index 6c97729254..4effdfa4a2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,9 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -try: - from trytond.modules.web_user.tests.test_web_user import suite -except ImportError: - from .test_web_user import suite - -__all__ = ['suite'] diff --git a/tests/test_web_user.py b/tests/test_module.py similarity index 95% rename from tests/test_web_user.py rename to tests/test_module.py index 374c2a722d..bf0530e5a6 100644 --- a/tests/test_web_user.py +++ b/tests/test_module.py @@ -1,16 +1,13 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import unittest from unittest.mock import ANY, patch from trytond.config import config from trytond.modules.party.tests import PartyCheckEraseMixin from trytond.modules.web_user import user as user_module from trytond.pool import Pool -from trytond.tests.test_tryton import ModuleTestCase -from trytond.tests.test_tryton import suite as test_suite -from trytond.tests.test_tryton import with_transaction +from trytond.tests.test_tryton import ModuleTestCase, with_transaction VALIDATION_URL = 'http://www.example.com/validation' RESET_PASSWORD_URL = 'http://www.example.com/reset_password' @@ -200,8 +197,4 @@ class WebUserTestCase(PartyCheckEraseMixin, ModuleTestCase): self.assertEqual(auth_user, user) -def suite(): - suite = test_suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - WebUserTestCase)) - return suite +del ModuleTestCase diff --git a/tox.ini b/tox.ini index 8275dd04fd..b171674be4 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,9 @@ envlist = {py37,py38,py39,py310}-{sqlite,postgresql} [testenv] +extras = test commands = - coverage run --include=.*/web_user/* setup.py test + coverage run --include=.*/web_user/* -m unittest discover -s tests coverage report --include=.*/web_user/* --omit=*/tests/* deps = coverage