[py3] Sort list of dicts by items in assertXSDAttributes
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 02 Oct 2019 14:53:12 +0200
changeset 3043 01ca8b6ba1d5
parent 3042 1dd2faa2de16
child 3044 fe168e4a546b
[py3] Sort list of dicts by items in assertXSDAttributes Apparently, this is what python2 does.
test/test_profile_generation.py
--- a/test/test_profile_generation.py	Wed Oct 02 14:42:30 2019 +0200
+++ b/test/test_profile_generation.py	Wed Oct 02 14:53:12 2019 +0200
@@ -202,7 +202,7 @@
                 adef['type'] = 'xsd:' + data_elements[0].attrib['type']
             self._element_fixed_value(adef, adef_element)
             adefs.append(adef)
-        return sorted(adefs)
+        return sorted(adefs, key=lambda d: list(d.items()))
 
     def _element_fixed_value(self, edef, element):
         values = self.xpath(element, 'rng:value')