Replace test setuptools command by unittest discover

issue9215
review389851002
This commit is contained in:
Cédric Krier
2022-04-16 18:30:17 +02:00
parent 1c946bbd33
commit 5a2776c06e
4 changed files with 6 additions and 19 deletions
+1 -3
View File
@@ -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,
)
-7
View File
@@ -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']
+3 -8
View File
@@ -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
+2 -1
View File
@@ -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