Replace test setuptools command by unittest discover

issue9215
review389851002
This commit is contained in:
Cédric Krier committed 2022-04-16 18:30:16 +02:00
1 parent 5808606c72
commit efb0b31c6c
4 files changed
+7 -19

No files matched your search

+3 -3
View File
@@ -141,13 +141,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_product = trytond.modules.account_product
""",
test_suite='tests',
test_loader='trytond.test_loader:Loader',
tests_require=tests_require,
)
-8
View File
@@ -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_product.tests.test_account_product import \
suite # noqa: E501
except ImportError:
from .test_account_product import suite
__all__ = ['suite']
@@ -1,9 +1,8 @@
# 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 decimal import Decimal
import trytond.tests.test_tryton
from trytond.exceptions import UserError
from trytond.modules.account.tests import create_chart
from trytond.modules.company.tests import (
@@ -116,8 +115,4 @@ class AccountProductTestCase(CompanyTestMixin, ModuleTestCase):
categories[1].account_expense_used
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
AccountProductTestCase))
return suite
del ModuleTestCase
+2 -1
View File
@@ -2,8 +2,9 @@
envlist = {py37,py38,py39,py310}-{sqlite,postgresql}
[testenv]
extras = test
commands =
coverage run --include=.*/account_product/* setup.py test
coverage run --include=.*/account_product/* -m unittest discover -s tests
coverage report --include=.*/account_product/* --omit=*/tests/*
deps =
coverage