From f5951900c8e79a116c59470b8f5b2f544000bf1f Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 18 May 2012 08:35:23 +0200 Subject: [PATCH] Make unit tests compatible with Python < 2.7. --- tests/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/__init__.py b/tests/__init__.py index c46f6ef6..09c4e4ba 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -59,6 +59,11 @@ class RQTestCase(unittest.TestCase): # Flush afterwards self.testconn.flushdb() + # Implement assertIsNotNone for Python runtimes < 2.7 or < 3.1 + if not hasattr(unittest.TestCase, 'assertIsNotNone'): + def assertIsNotNone(self, value, *args): + self.assertNotEqual(value, None, *args) + @classmethod def tearDownClass(cls): cls.log_handler.pop_thread()