# HG changeset patch # User Denis Laxalde # Date 1466525500 -7200 # Node ID bd3cd3691ade5b40bc556fc150ea50440245a630 # Parent e68991426d7d3f755f485460ac31e52d60b1a6ac [test] Avoid assertCountEqual in unittest_syncschema.py It's not clear why this happens, but it seems that assertCountEqual does strange things with unittest2 on Python 2 for equality comparison (trying to sort constraint objects, even though BaseConstraint raise NotImplemented in __lt__ from Yams 0.43). So just avoid using it to get this test passing. diff -r e68991426d7d -r bd3cd3691ade cubicweb/hooks/test/unittest_syncschema.py --- a/cubicweb/hooks/test/unittest_syncschema.py Wed Jun 22 11:01:16 2016 +0200 +++ b/cubicweb/hooks/test/unittest_syncschema.py Tue Jun 21 18:11:40 2016 +0200 @@ -398,7 +398,9 @@ 'EDEF constrained_by X WHERE CT name %(ct)s, EDEF eid %(x)s', {'ct': cstr3.__class__.__name__, 'v': cstr3.serialize(), 'x': rdef.eid}) cnx.commit() - self.assertCountEqual(rdef.constraints, [cstr, cstr3]) + # Do not use assertCountEqual as it does "strange" equality + # comparison on Python 2. + self.assertEqual(set(rdef.constraints), set([cstr, cstr3])) if __name__ == '__main__':