From aef4cfd201ae3ca586319bdabc3f443cf8477615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 16 Apr 2022 18:30:15 +0200 Subject: [PATCH] Replace test setuptools command by unittest discover issue9215 review389851002 --- setup.py | 2 -- tests/__init__.py | 7 ------- tests/{test_account_be.py => test_module.py} | 8 +------- tox.ini | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) rename tests/{test_account_be.py => test_module.py} (75%) diff --git a/setup.py b/setup.py index 6338e3808e..0912bdcaf6 100755 --- a/setup.py +++ b/setup.py @@ -124,6 +124,4 @@ setup(name=name, [trytond.modules] account_be = trytond.modules.account_be """, - test_suite='tests', - test_loader='trytond.test_loader:Loader', ) diff --git a/tests/__init__.py b/tests/__init__.py index d01f3150e3..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.account_be.tests.test_account_be import suite -except ImportError: - from .test_account_be import suite - -__all__ = ['suite'] diff --git a/tests/test_account_be.py b/tests/test_module.py similarity index 75% rename from tests/test_account_be.py rename to tests/test_module.py index 2235068b8f..1311e1d410 100644 --- a/tests/test_account_be.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.tests import create_chart from trytond.modules.company.tests import create_company, set_company from trytond.tests.test_tryton import ModuleTestCase, with_transaction @@ -20,8 +18,4 @@ class AccountBETestCase(ModuleTestCase): create_chart(company, chart=self.module + '.root_' + self.language) -def suite(): - suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase( - AccountBETestCase)) - return suite +del ModuleTestCase diff --git a/tox.ini b/tox.ini index c52b3fc8ed..7fac5769bc 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = {py37,py38,py39,py310}-{sqlite,postgresql} [testenv] commands = - coverage run --include=.*/account_be/* setup.py test + coverage run --include=.*/account_be/* -m unittest discover -s tests coverage report --include=.*/account_be/* --omit=*/tests/* deps = coverage