changeset f05f620d16d3 in modules/account_be:default
details:
https://hg.tryton.org/modules/account_be?cmd=changeset&node=f05f620d16d3
description:
Replace test setuptools command by unittest discover
issue9215
review389851002
diffstat:
setup.py | 2 --
tests/__init__.py | 7 -------
tests/test_account_be.py | 27 ---------------------------
tests/test_module.py | 21 +++++++++++++++++++++
tox.ini | 2 +-
5 files changed, 22 insertions(+), 37 deletions(-)
diffs (91 lines):
diff -r 74934ec54954 -r f05f620d16d3 setup.py
--- a/setup.py Sun Apr 10 19:11:37 2022 +0200
+++ b/setup.py Sat Apr 16 18:30:15 2022 +0200
@@ -124,6 +124,4 @@
[trytond.modules]
account_be = trytond.modules.account_be
""",
- test_suite='tests',
- test_loader='trytond.test_loader:Loader',
)
diff -r 74934ec54954 -r f05f620d16d3 tests/__init__.py
--- a/tests/__init__.py Sun Apr 10 19:11:37 2022 +0200
+++ b/tests/__init__.py Sat Apr 16 18:30:15 2022 +0200
@@ -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 -r 74934ec54954 -r f05f620d16d3 tests/test_account_be.py
--- a/tests/test_account_be.py Sun Apr 10 19:11:37 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-# 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
-
-
-class AccountBETestCase(ModuleTestCase):
- 'Test Account BE module'
- module = 'account_be'
- language = 'fr'
-
- @with_transaction()
- def test_create_chart(self):
- company = create_company()
- with set_company(company):
- 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
diff -r 74934ec54954 -r f05f620d16d3 tests/test_module.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_module.py Sat Apr 16 18:30:15 2022 +0200
@@ -0,0 +1,21 @@
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
+
+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
+
+
+class AccountBETestCase(ModuleTestCase):
+ 'Test Account BE module'
+ module = 'account_be'
+ language = 'fr'
+
+ @with_transaction()
+ def test_create_chart(self):
+ company = create_company()
+ with set_company(company):
+ create_chart(company, chart=self.module + '.root_' + self.language)
+
+
+del ModuleTestCase
diff -r 74934ec54954 -r f05f620d16d3 tox.ini
--- a/tox.ini Sun Apr 10 19:11:37 2022 +0200
+++ b/tox.ini Sat Apr 16 18:30:15 2022 +0200
@@ -3,7 +3,7 @@
[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