diff tests/test_util.py @ 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 c31a1f92e1c6
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),