changeset 744:6d6be5284056

tests: make assertMultiLineEqual call super, if possible. Python 2.7 provides such a method.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 11 Nov 2010 21:30:31 +0100
parents 045120d3a110
children 6252f0cc7b7a
files tests/test_util.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -405,6 +405,12 @@ class TestBase(unittest.TestCase):
     def assertMultiLineEqual(self, first, second, msg=None):
         """Assert that two multi-line strings are equal. (Based on Py3k code.)
         """
+        try:
+            return super(TestBase, self).assertMultiLineEqual(first, second,
+                                                              msg)
+        except AttributeError:
+            pass
+
         self.assert_(isinstance(first, str),
                      ('First argument is not a string'))
         self.assert_(isinstance(second, str),