diff --git a/setup.py b/setup.py index 7cfb702a12..cfa293211e 100755 --- a/setup.py +++ b/setup.py @@ -140,13 +140,13 @@ setup(name=name, license='GPL-3', python_requires='>=3.7', install_requires=requires, + extras_require={ + 'test': tests_require, + }, dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] account_payment_sepa_cfonb = trytond.modules.account_payment_sepa_cfonb """, - test_suite='tests', - test_loader='trytond.test_loader:Loader', - tests_require=tests_require, ) diff --git a/tests/__init__.py b/tests/__init__.py index e15c00d858..4effdfa4a2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,10 +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.account_payment_sepa_cfonb.tests.test_account_payment_sepa_cfonb import \ - suite # noqa: E501 -except ImportError: - from .test_account_payment_sepa_cfonb import suite - -__all__ = ['suite'] diff --git a/tests/test_account_payment_sepa_cfonb.py b/tests/test_module.py similarity index 79% rename from tests/test_account_payment_sepa_cfonb.py rename to tests/test_module.py index 6b00376557..3125baf9b7 100644 --- a/tests/test_account_payment_sepa_cfonb.py +++ b/tests/test_module.py @@ -1,8 +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 -import trytond.tests.test_tryton from trytond.modules.account_payment_sepa.tests import validate_file from trytond.modules.company.tests import CompanyTestMixin from trytond.tests.test_tryton import ModuleTestCase, with_transaction @@ -25,8 +23,4 @@ class AccountPaymentSepaCFONBTestCase(CompanyTestMixin, ModuleTestCase): xsd='pain.008.001.02') -def suite(): - suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - AccountPaymentSepaCFONBTestCase)) - return suite +del ModuleTestCase diff --git a/tox.ini b/tox.ini index 822d8e50a6..c34d5c2799 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=.*/account_payment_sepa_cfonb/* setup.py test + coverage run --include=.*/account_payment_sepa_cfonb/* -m unittest discover -s tests coverage report --include=.*/account_payment_sepa_cfonb/* --omit=*/tests/* deps = coverage