diff --git a/tests/py/test_unittest.py b/tests/py/test_unittest.py
index <HASH>..<HASH> 100644
--- a/tests/py/test_unittest.py
+++ b/tests/py/test_unittest.py
@@ -19,10 +19,17 @@
 
 import unittest
 
-def assertMultiLineEqual(self, a, b, msg=None): self.assertEqual(a,b,msg)
-unittest.TestCase.assertMultiLineEqual = assertMultiLineEqual
+# Monkey-patch a few unittest 2.7 features for Python 2.6.
+#
+# These are note the pretty versions provided by 2.7 but they do the
+# same job as far as correctness is concerned.
+
+if not hasattr(unittest.TestCase, "assertMultiLineEqual"):
+    def assertMultiLineEqual(self, a, b, msg=None): self.assertEqual(a,b,msg)
+    unittest.TestCase.assertMultiLineEqual = assertMultiLineEqual
 
-def assertIn(self, a, b, msg=None): self.assertTrue(a in b,msg)
-unittest.TestCase.assertIn = assertIn
+if not hasattr(unittest.TestCase, "assertIn"):
+    def assertIn(self, a, b, msg=None): self.assertTrue(a in b,msg)
+    unittest.TestCase.assertIn = assertIn
NO-JIRA: [c,cpp] fix monkey-patch of python <I> unittest features for python <I>

Don't apply patch on versions that have the feature.