diff --git a/setup.py b/setup.py index ca880ae474..a400d22bad 100755 --- a/setup.py +++ b/setup.py @@ -139,6 +139,7 @@ setup(name=name, install_requires=requires, extras_require={ 'SWIFT': ['schwifty'], + 'test': tests_require, }, dependency_links=dependency_links, zip_safe=False, @@ -146,7 +147,4 @@ setup(name=name, [trytond.modules] bank = trytond.modules.bank """, - test_suite='tests', - test_loader='trytond.test_loader:Loader', - tests_require=tests_require, ) diff --git a/tests/__init__.py b/tests/__init__.py index 1f6d66a0ef..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.bank.tests.test_bank import suite -except ImportError: - from .test_bank import suite - -__all__ = ['suite'] diff --git a/tests/test_bank.py b/tests/test_module.py similarity index 95% rename from tests/test_bank.py rename to tests/test_module.py index fb5b0bfead..54b9c095d8 100644 --- a/tests/test_bank.py +++ b/tests/test_module.py @@ -1,5 +1,6 @@ # 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 try: @@ -7,13 +8,11 @@ try: except ImportError: schwifty = None -import trytond.tests.test_tryton from trytond.model.exceptions import SQLConstraintError +from trytond.modules.bank.exceptions import InvalidBIC from trytond.pool import Pool from trytond.tests.test_tryton import ModuleTestCase, with_transaction -from ..exceptions import InvalidBIC - class BankTestCase(ModuleTestCase): 'Test Bank module' @@ -157,8 +156,4 @@ class BankTestCase(ModuleTestCase): self.assertEqual(len(Bank.search([])), 1) -def suite(): - suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - BankTestCase)) - return suite +del ModuleTestCase diff --git a/tox.ini b/tox.ini index fc6e872bac..7a6cf05836 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=.*/bank/* setup.py test + coverage run --include=.*/bank/* -m unittest discover -s tests coverage report --include=.*/bank/* --omit=*/tests/* deps = coverage