Replace test setuptools command by unittest discover

issue9215
review389851002
This commit is contained in:
Cédric Krier committed 2022-04-16 18:30:18 +02:00
1 parent f14fd9ac3f
commit 2fe4ce8277
4 files changed
+7 -21

No files matched your search

+3 -3
View File
@@ -137,13 +137,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]
production_split = trytond.modules.production_split
""",
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.production_split.tests.test_production_split import \
suite # noqa: E501
except ImportError:
from .test_production_split import suite
__all__ = ['suite']
@@ -1,13 +1,10 @@
# 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 patch
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
class ProductionSplitTestCase(ModuleTestCase):
@@ -45,8 +42,4 @@ class ProductionSplitTestCase(ModuleTestCase):
[p.quantity for p in productions], quantities)
def suite():
suite = test_suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
ProductionSplitTestCase))
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=.*/production_split/* setup.py test
coverage run --include=.*/production_split/* -m unittest discover -s tests
coverage report --include=.*/production_split/* --omit=*/tests/*
deps =
coverage