Any objections to the attached fix?

Regards,
Alexey.

On 12/17/2014 05:43 AM, Bert Huijben wrote:

-----Original Message-----
From: sti...@apache.org [mailto:sti...@apache.org]
Sent: dinsdag 2 december 2014 08:54
To: comm...@subversion.apache.org
Subject: svn commit: r1642813 - in /subversion/trunk/subversion/bindings/swig:
include/svn_types.swg python/libsvn_swig_py/swigutil_py.c
python/libsvn_swig_py/swigutil_py.h python/svn/core.py python/svn/repos.py
python/tests/repository.py svn_repos.i

Author: stilor
Date: Tue Dec  2 07:53:53 2014
New Revision: 1642813
This patch introduces a dependency on assertListEqual() - new in Python 2.7- in 
the test suite, which seems to fail on at least one of our buildbots.

Is it possible to rewrite this test to keep compatibility with older python 
versions?

Thanks,

        Bert




Index: repository.py
===================================================================
--- repository.py	(revision 1646305)
+++ repository.py	(working copy)
@@ -87,6 +87,12 @@
 class SubversionRepositoryTestCase(unittest.TestCase):
   """Test cases for the Subversion repository layer"""
 
+  def _assertListEqual(self, l1, l2):
+    """Poor man's replacement for assertListEqual, available in Python 2.7+"""
+    self.assertEqual(len(l1), len(l2))
+    for i in range(0, len(l1)):
+      self.assertEqual(l1[i], l2[i])
+
   def setUp(self):
     """Load a Subversion repository"""
     self.temper = utils.Temper()
@@ -94,6 +100,9 @@
       'trac/versioncontrol/tests/svnrepos.dump', suffix='-repository')
     self.fs = repos.fs(self.repos)
     self.rev = fs.youngest_rev(self.fs)
+    # Older (<2.7) Pythons lack assertListEqual
+    if 'assertListEqual' not in self.__class__.__dict__:
+      self.assertListEqual = self._assertListEqual
 
   def tearDown(self):
     self.fs = None

Reply via email to