Commits

Matt Chaput  committed c7e61bb

Sort keyword arguments in function query test class __repr__ to stabilize test results.

  • Participants
  • Parent commits 964f650

Comments (0)

Files changed (2)

File tests/test_parse_plugins.py

         def __unicode__(self):
             qs = "|".join(str(q) for q in self.children)
             args = ",".join(self.args)
-            kwargs = ",".join("%s:%s" % item for item in self.kwargs.items())
+            kwargs = ",".join(sorted("%s:%s" % item for item in self.kwargs.items()))
             return u("<%s %s %s>") % (qs, args, kwargs)
 
         __str__ = __unicode__

File tests/test_sorting.py

         q3 = query.TermRange("v", "g", "i")
 
         facets = sorting.Facets()
-        facets.add_query("myfacet", {"a-c": q1, "d-f": q2, "g-i": q3},
-                         allow_overlap=True)
+        facets.add_query("myfacet", {"a-c": q1, "d-f": q2, "g-i": q3}, allow_overlap=True)
         r = s.search(query.Every(), groupedby=facets)
-        assert r.groups("myfacet") == {'a-c': [0, 1, 2, 7, 8],
-                                       'd-f': [4, 5],
-                                       'g-i': [3, 6]}
+        assert r.groups("myfacet") == {'a-c': [0, 1, 2, 7, 8], 'd-f': [4, 5], 'g-i': [3, 6]}
 
 
 def test_missing_field_facet():