changeset 87d05202fd06 in modules/timesheet:default
details: https://hg.tryton.org/modules/timesheet?cmd=changeset&node=87d05202fd06
description:
        Replace test setuptools command by unittest discover

        issue9215
        review389851002
diffstat:

 setup.py                |   2 --
 tests/__init__.py       |   7 -------
 tests/test_module.py    |  13 +++++++++++++
 tests/test_timesheet.py |  19 -------------------
 tox.ini                 |   2 +-
 5 files changed, 14 insertions(+), 29 deletions(-)

diffs (75 lines):

diff -r 85b56a007590 -r 87d05202fd06 setup.py
--- a/setup.py  Mon Apr 11 23:24:21 2022 +0200
+++ b/setup.py  Sat Apr 16 18:30:20 2022 +0200
@@ -145,6 +145,4 @@
     [trytond.modules]
     timesheet = trytond.modules.timesheet
     """,
-    test_suite='tests',
-    test_loader='trytond.test_loader:Loader',
     )
diff -r 85b56a007590 -r 87d05202fd06 tests/__init__.py
--- a/tests/__init__.py Mon Apr 11 23:24:21 2022 +0200
+++ b/tests/__init__.py Sat Apr 16 18:30:20 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.timesheet.tests.test_timesheet import suite
-except ImportError:
-    from .test_timesheet import suite
-
-__all__ = ['suite']
diff -r 85b56a007590 -r 87d05202fd06 tests/test_module.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_module.py      Sat Apr 16 18:30:20 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 TimesheetTestCase(CompanyTestMixin, ModuleTestCase):
+    'Test Timesheet module'
+    module = 'timesheet'
+
+
+del ModuleTestCase
diff -r 85b56a007590 -r 87d05202fd06 tests/test_timesheet.py
--- a/tests/test_timesheet.py   Mon Apr 11 23:24:21 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 TimesheetTestCase(CompanyTestMixin, ModuleTestCase):
-    'Test Timesheet module'
-    module = 'timesheet'
-
-
-def suite():
-    suite = trytond.tests.test_tryton.suite()
-    suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
-        TimesheetTestCase))
-    return suite
diff -r 85b56a007590 -r 87d05202fd06 tox.ini
--- a/tox.ini   Mon Apr 11 23:24:21 2022 +0200
+++ b/tox.ini   Sat Apr 16 18:30:20 2022 +0200
@@ -3,7 +3,7 @@
 
 [testenv]
 commands =
-    coverage run --include=.*/timesheet/* setup.py test
+    coverage run --include=.*/timesheet/* -m unittest discover -s tests
     coverage report --include=.*/timesheet/* --omit=*/tests/*
 deps =
     coverage

Reply via email to