summaryrefslogtreecommitdiff
path: root/tests/testutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testutils.py')
-rw-r--r--tests/testutils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index 49d26b2..6738718 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -41,6 +41,16 @@ else:
unittest.TestCase.skipTest = skipTest
+# Silence warnings caused by the stubborness of the Python unittest maintainers
+# http://bugs.python.org/issue9424
+if not hasattr(unittest.TestCase, 'assert_') \
+or unittest.TestCase.assert_ is not unittest.TestCase.assertTrue:
+ # mavaff...
+ unittest.TestCase.assert_ = unittest.TestCase.assertTrue
+ unittest.TestCase.failUnless = unittest.TestCase.assertTrue
+ unittest.TestCase.assertEquals = unittest.TestCase.assertEqual
+ unittest.TestCase.failUnlessEqual = unittest.TestCase.assertEqual
+
def decorate_all_tests(cls, decorator):
"""Apply *decorator* to all the tests defined in the TestCase *cls*."""