[test] convert a lgc-style generative test into unittest2-style
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 18 Feb 2016 09:20:57 +0100
changeset 11164 e3fa26bd9ce0
parent 11163 141e96f93c4d
child 11165 c6fe858f6b90
[test] convert a lgc-style generative test into unittest2-style
cubicweb/test/unittest_schema.py
--- a/cubicweb/test/unittest_schema.py	Mon Feb 08 16:10:22 2016 +0100
+++ b/cubicweb/test/unittest_schema.py	Thu Feb 18 09:20:57 2016 +0100
@@ -553,10 +553,10 @@
                          [eschema.type for eschema in sorted(schema.entities())
                           if eschema.is_composite])
         for etype in self.composites:
-            self.set_description('composite rdefs for %s' % etype)
-            yield self.assertEqual, self.composites[etype], \
-                             sorted([(r.rtype.type, r.subject.type, r.object.type, role)
-                                     for r, role in schema[etype].composite_rdef_roles])
+            with self.subTest(etype=etype):
+                self.assertEqual(self.composites[etype],
+                                 sorted([(r.rtype.type, r.subject.type, r.object.type, role)
+                                         for r, role in schema[etype].composite_rdef_roles]))
 
 
 if __name__ == '__main__':