clean the unittest2.
We have used the testtools instead of unittest2. So when we run
tempest, if it require unittest2 packages. We should look into
why it need unittest2, and can we use testtools instead? Not just
add unittest2 in pip-require simply. And new test added into
tempest should use testtools other than unittest2.
Change-Id: Ica02779b16434f9d64b0bb655c44251301b94492
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index de22688..6b9ce74 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import unittest2 as unittest
+import testtools
class TempestException(Exception):
@@ -53,7 +53,7 @@
class RestClientException(TempestException,
- unittest.TestCase.failureException):
+ testtools.TestCase.failureException):
pass
diff --git a/tempest/tests/compute/admin/test_flavors_extra_specs.py b/tempest/tests/compute/admin/test_flavors_extra_specs.py
index 2645153..5dd38d4 100644
--- a/tempest/tests/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/tests/compute/admin/test_flavors_extra_specs.py
@@ -21,7 +21,7 @@
from tempest import exceptions
from tempest.tests import compute
from tempest.tests.compute import base
-import unittest2 as unittest
+import testtools
class FlavorsExtraSpecsTestBase(object):
@@ -79,7 +79,7 @@
self.client.unset_flavor_extra_spec(self.flavor['id'], "key1")
self.assertEqual(unset_resp.status, 200)
- @unittest.skip('Until bug 1094142 is resolved.')
+ @testtools.skip('Until bug 1094142 is resolved.')
def test_flavor_non_admin_set_get_unset_keys(self):
#Test to SET, GET UNSET flavor extra spec as a user
#with out admin privileges.
diff --git a/tempest/tests/identity/admin/test_services.py b/tempest/tests/identity/admin/test_services.py
index 73f4a90..b74266c 100644
--- a/tempest/tests/identity/admin/test_services.py
+++ b/tempest/tests/identity/admin/test_services.py
@@ -17,7 +17,6 @@
from nose.plugins.attrib import attr
-import unittest2 as unittest
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
diff --git a/tools/pip-requires b/tools/pip-requires
index 504ca24..0147cd8 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -11,5 +11,4 @@
python-novaclient>=2.10.0
python-quantumclient>=2.1
testresources
-unittest2
keyring