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

        issue9215
        review389851002
diffstat:

 setup.py              |   2 --
 tests/__init__.py     |   7 -------
 tests/test_carrier.py |  18 ------------------
 tests/test_module.py  |  12 ++++++++++++
 tox.ini               |   2 +-
 5 files changed, 13 insertions(+), 28 deletions(-)

diffs (73 lines):

diff -r a43d05f7c1a4 -r de38fd49f27a 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]
     carrier = trytond.modules.carrier
     """,
-    test_suite='tests',
-    test_loader='trytond.test_loader:Loader',
     )
diff -r a43d05f7c1a4 -r de38fd49f27a 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,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.carrier.tests.test_carrier import suite
-except ImportError:
-    from .test_carrier import suite
-
-__all__ = ['suite']
diff -r a43d05f7c1a4 -r de38fd49f27a tests/test_carrier.py
--- a/tests/test_carrier.py     Sun Apr 10 19:11:38 2022 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +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.tests.test_tryton import ModuleTestCase
-
-
-class CarrierTestCase(ModuleTestCase):
-    'Test Carrier module'
-    module = 'carrier'
-
-
-def suite():
-    suite = trytond.tests.test_tryton.suite()
-    suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
-            CarrierTestCase))
-    return suite
diff -r a43d05f7c1a4 -r de38fd49f27a 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,12 @@
+# 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.tests.test_tryton import ModuleTestCase
+
+
+class CarrierTestCase(ModuleTestCase):
+    'Test Carrier module'
+    module = 'carrier'
+
+
+del ModuleTestCase
diff -r a43d05f7c1a4 -r de38fd49f27a 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=.*/carrier/* setup.py test
+    coverage run --include=.*/carrier/* -m unittest discover -s tests
     coverage report --include=.*/carrier/* --omit=*/tests/*
 deps =
     coverage

Reply via email to