diff test/test_indexer.py @ 4102:dcca66d56815

fix unit test compatibility
author Richard Jones <richard@users.sourceforge.net>
date Fri, 13 Mar 2009 03:31:30 +0000
parents 96a5e0845adb
children 2b1241daaa20
line wrap: on
line diff
--- a/test/test_indexer.py	Fri Mar 13 00:11:58 2009 +0000
+++ b/test/test_indexer.py	Fri Mar 13 03:31:30 2009 +0000
@@ -48,14 +48,14 @@
         self.dex.load_index()
 
     def assertSeqEqual(self, s1, s2):
-        # first argument is the db result we're testing, second is the
-        # desired result some db results don't have iterable rows, so we
-        # have to work around that
+        # First argument is the db result we're testing, second is the
+        # desired result. Some db results don't have iterable rows, so we
+        # have to work around that.
         # Also work around some dbs not returning items in the expected
-        # order. This would be *so* much easier with python2.4's sorted.
-        s1 = list(s1)
+        # order.
+        s1 = list([tuple([r[n] for n in range(len(r))]) for r in s1])
         s1.sort()
-        if [i for x,y in zip(s1, s2) for i,j in enumerate(y) if x[i] != j]:
+        if s1 != s2:
             self.fail('contents of %r != %r'%(s1, s2))
 
     def test_basics(self):

Roundup Issue Tracker: http://roundup-tracker.org/