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

        issue9215
        review389851002
diffstat:

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

diffs (74 lines):

diff -r 5e7aaf3d34bd -r e325b4f9b6f1 setup.py
--- a/setup.py  Sun Apr 10 19:11:37 2022 +0200
+++ b/setup.py  Sat Apr 16 18:30:16 2022 +0200
@@ -143,6 +143,4 @@
     [trytond.modules]
     account_invoice_history = trytond.modules.account_invoice_history
     """,
-    test_suite='tests',
-    test_loader='trytond.test_loader:Loader',
     )
diff -r 5e7aaf3d34bd -r e325b4f9b6f1 tests/__init__.py
--- a/tests/__init__.py Sun Apr 10 19:11:37 2022 +0200
+++ b/tests/__init__.py Sat Apr 16 18:30:16 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.account_invoice_history.tests.test_account_invoice_history 
import \
-        suite  # noqa: E501
-except ImportError:
-    from .test_account_invoice_history import suite
-
-__all__ = ['suite']
diff -r 5e7aaf3d34bd -r e325b4f9b6f1 tests/test_account_invoice_history.py
--- a/tests/test_account_invoice_history.py     Sun Apr 10 19:11:37 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 AccountInvoiceHistoryTestCase(ModuleTestCase):
-    'Test AccountInvoiceHistory module'
-    module = 'account_invoice_history'
-
-
-def suite():
-    suite = trytond.tests.test_tryton.suite()
-    suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
-        AccountInvoiceHistoryTestCase))
-    return suite
diff -r 5e7aaf3d34bd -r e325b4f9b6f1 tests/test_module.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_module.py      Sat Apr 16 18:30:16 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 AccountInvoiceHistoryTestCase(ModuleTestCase):
+    'Test AccountInvoiceHistory module'
+    module = 'account_invoice_history'
+
+
+del ModuleTestCase
diff -r 5e7aaf3d34bd -r e325b4f9b6f1 tox.ini
--- a/tox.ini   Sun Apr 10 19:11:37 2022 +0200
+++ b/tox.ini   Sat Apr 16 18:30:16 2022 +0200
@@ -3,7 +3,7 @@
 
 [testenv]
 commands =
-    coverage run --include=.*/account_invoice_history/* setup.py test
+    coverage run --include=.*/account_invoice_history/* -m unittest discover 
-s tests
     coverage report --include=.*/account_invoice_history/* --omit=*/tests/*
 deps =
     coverage

Reply via email to