From 06b48c202675d1610b01fd4557d29b92f9a17d65 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 23 Jan 2013 22:43:30 +0100 Subject: [PATCH] Use unittest2 for Python 2.6. --- tests/__init__.py | 6 +++++- tests/test_scripts.py | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 398d23a..cba1035 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,9 @@ import logging -import unittest +from rq.compat import is_python_version +if is_python_version((2, 7), (3, 2)): + import unittest +else: + import unittest2 as unittest # noqa from redis import Redis from rq import push_connection, pop_connection diff --git a/tests/test_scripts.py b/tests/test_scripts.py index de266ef..ae661c7 100644 --- a/tests/test_scripts.py +++ b/tests/test_scripts.py @@ -1,6 +1,11 @@ -from unittest import TestCase +from rq.compat import is_python_version +if is_python_version((2, 7), (3, 2)): + from unittest import TestCase +else: + from unittest2 import TestCase # noqa from rq.scripts import read_config_file + class TestScripts(TestCase): def test_config_file(self): settings = read_config_file("tests.dummy_settings")