From c7848251b5cd7688feb493414d56545d89c60e51 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Mon, 9 Sep 2013 23:50:13 -0400 Subject: [PATCH] use unittest2 for python2.6 --- riakcached/tests/test_client.py | 21 +++++++++++---------- test-requirements.txt | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/riakcached/tests/test_client.py b/riakcached/tests/test_client.py index d966ca6..e0640f9 100644 --- a/riakcached/tests/test_client.py +++ b/riakcached/tests/test_client.py @@ -1,14 +1,15 @@ -import unittest import mock +import unittest2 import urllib3.exceptions + from riakcached import exceptions from riakcached.client import RiakClient from riakcached.tests.utils import InlineClass -class TestRiakClient(unittest.TestCase): +class TestRiakClient(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -76,7 +77,7 @@ class TestRiakClient(unittest.TestCase): ) -class TestGet(unittest.TestCase): +class TestGet(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -179,7 +180,7 @@ class TestGet(unittest.TestCase): ) -class TestSet(unittest.TestCase): +class TestSet(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -297,7 +298,7 @@ class TestSet(unittest.TestCase): ) -class TestDelete(unittest.TestCase): +class TestDelete(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -364,7 +365,7 @@ class TestDelete(unittest.TestCase): ) -class TestCounter(unittest.TestCase): +class TestCounter(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -423,7 +424,7 @@ class TestCounter(unittest.TestCase): self.assertFalse(client.incr("test")) -class TestPing(unittest.TestCase): +class TestPing(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -463,7 +464,7 @@ class TestPing(unittest.TestCase): self.assertFalse(client.ping()) -class TestStats(unittest.TestCase): +class TestStats(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -503,7 +504,7 @@ class TestStats(unittest.TestCase): self.assertIsNone(client.stats()) -class TestProps(unittest.TestCase): +class TestProps(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() @@ -563,7 +564,7 @@ class TestProps(unittest.TestCase): ) -class TestKeys(unittest.TestCase): +class TestKeys(unittest2.TestCase): def setUp(self): self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.connection_from_url = self.patched_connection_from_url.start() diff --git a/test-requirements.txt b/test-requirements.txt index 8a8f980..1c35758 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,3 @@ mock +unittest2 -r requirements.txt