changeset bfbd2c379a74 in modules/company_work_time:default
details:
https://hg.tryton.org/modules/company_work_time?cmd=changeset&node=bfbd2c379a74
description:
Replace test setuptools command by unittest discover
issue9215
review389851002
diffstat:
setup.py | 2 --
tests/__init__.py | 8 --------
tests/test_company_work_time.py | 19 -------------------
tests/test_module.py | 13 +++++++++++++
tox.ini | 2 +-
5 files changed, 14 insertions(+), 30 deletions(-)
diffs (76 lines):
diff -r ec574c8d6e99 -r bfbd2c379a74 setup.py
--- a/setup.py Sun Apr 10 19:11:38 2022 +0200
+++ b/setup.py Sat Apr 16 18:30:17 2022 +0200
@@ -142,6 +142,4 @@
[trytond.modules]
company_work_time = trytond.modules.company_work_time
""",
- test_suite='tests',
- test_loader='trytond.test_loader:Loader',
)
diff -r ec574c8d6e99 -r bfbd2c379a74 tests/__init__.py
--- a/tests/__init__.py Sun Apr 10 19:11:38 2022 +0200
+++ b/tests/__init__.py Sat Apr 16 18:30:17 2022 +0200
@@ -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.company_work_time.tests.test_company_work_time import
\
- suite # noqa: E501
-except ImportError:
- from .test_company_work_time import suite
-
-__all__ = ['suite']
diff -r ec574c8d6e99 -r bfbd2c379a74 tests/test_company_work_time.py
--- a/tests/test_company_work_time.py Sun Apr 10 19:11:38 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +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.company.tests import CompanyTestMixin
-from trytond.tests.test_tryton import ModuleTestCase
-
-
-class CompanyWorkTimeTestCase(CompanyTestMixin, ModuleTestCase):
- 'Test CompanyWorkTime module'
- module = 'company_work_time'
-
-
-def suite():
- suite = trytond.tests.test_tryton.suite()
- suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
- CompanyWorkTimeTestCase))
- return suite
diff -r ec574c8d6e99 -r bfbd2c379a74 tests/test_module.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_module.py Sat Apr 16 18:30:17 2022 +0200
@@ -0,0 +1,13 @@
+# 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.company.tests import CompanyTestMixin
+from trytond.tests.test_tryton import ModuleTestCase
+
+
+class CompanyWorkTimeTestCase(CompanyTestMixin, ModuleTestCase):
+ 'Test CompanyWorkTime module'
+ module = 'company_work_time'
+
+
+del ModuleTestCase
diff -r ec574c8d6e99 -r bfbd2c379a74 tox.ini
--- a/tox.ini Sun Apr 10 19:11:38 2022 +0200
+++ b/tox.ini Sat Apr 16 18:30:17 2022 +0200
@@ -3,7 +3,7 @@
[testenv]
commands =
- coverage run --include=.*/company_work_time/* setup.py test
+ coverage run --include=.*/company_work_time/* -m unittest discover -s tests
coverage report --include=.*/company_work_time/* --omit=*/tests/*
deps =
coverage