details:   https://code.tryton.org/tryton/commit/a05fa06b3a4c
branch:    default
user:      Nicolas Évrard <[email protected]>
date:      Tue Jul 07 07:31:32 2026 +0200
description:
        Use subtest for each button method tested
diffstat:

 trytond/trytond/tests/test_tryton.py |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (25 lines):

diff -r 6236378a9cd3 -r a05fa06b3a4c trytond/trytond/tests/test_tryton.py
--- a/trytond/trytond/tests/test_tryton.py      Tue Jul 07 00:04:54 2026 +0200
+++ b/trytond/trytond/tests/test_tryton.py      Tue Jul 07 07:31:32 2026 +0200
@@ -1173,13 +1173,14 @@
             if not issubclass(model, ModelView):
                 continue
             for button in model._buttons:
-                try:
-                    if is_instance_method(model, button):
-                        getattr(model(), button)()
-                    else:
-                        getattr(model, button)([])
-                except (UserError, UserWarning):
-                    pass
+                with self.subTest(model=model.__name__, button=button):
+                    try:
+                        if is_instance_method(model, button):
+                            getattr(model(), button)()
+                        else:
+                            getattr(model, button)([])
+                    except (UserError, UserWarning):
+                        pass
 
     @with_transaction()
     def test_xml_files(self):

Reply via email to