Make unit tests compatible with Python < 2.7.

This commit is contained in:
Vincent Driessen 2012-05-18 08:35:23 +02:00
parent b45770cd3c
commit f5951900c8
1 changed files with 5 additions and 0 deletions

View File

@ -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()