From ee17d849dde71195eb544eb2421a35fb8bac5a06 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Thu, 29 May 2014 14:06:57 +0200 Subject: [PATCH] enable hacking check H234 assertEquals() logs a DeprecationWarning in Python 3.x, use assertEqual() instead. The same goes for assertNotEquals(). Change-Id: I73de77fe6a4c844856a9e15d5726dffcc8299734 --- graffiti/api/tests/test_controller_v1.py | 18 +++++++++--------- tox.ini | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/graffiti/api/tests/test_controller_v1.py b/graffiti/api/tests/test_controller_v1.py index a980c0d..a91b8e4 100644 --- a/graffiti/api/tests/test_controller_v1.py +++ b/graffiti/api/tests/test_controller_v1.py @@ -45,16 +45,16 @@ class TestControllerV1(base.TestCase): def test_v1_namespace_controller_factory__memory(self): rc = NSDAOFactory.create('memory') - self.assertEquals(rc.get_type(), 'MemNSDAO') + self.assertEqual(rc.get_type(), 'MemNSDAO') # TODO(Lakshmi): Create folder before any tests run # def test_v1_namespace_controller_factory__file(self): # rc = NSControllerFactory.create('file') - # self.assertEquals(rc.get_type(), 'FileNSDAO') + # self.assertEqual(rc.get_type(), 'FileNSDAO') def test_v1_namespace_controller_factory__db(self): rc = NSDAOFactory.create('db') - self.assertEquals(rc.get_type(), 'DBNSDAO') + self.assertEqual(rc.get_type(), 'DBNSDAO') def test_v1_capability_type_exists(self): v1 = V1Controller() @@ -62,16 +62,16 @@ class TestControllerV1(base.TestCase): def test_v1_capability_type_dao_factory__memory(self): rc = CapabilityTypeDAOFactory.create('memory') - self.assertEquals(rc.get_type(), 'MemCapabilityTypeDAO') + self.assertEqual(rc.get_type(), 'MemCapabilityTypeDAO') # TODO(Lakshmi): Create folder before any tests run # def test_v1_capability_type_dao_factory__file(self): # rc = CapabilityTypeDAOFactory.create('file') - # self.assertEquals(rc.get_type(), 'FileCapabilityTypeDAO') + # self.assertEqual(rc.get_type(), 'FileCapabilityTypeDAO') def test_v1_capability_type_dao_factory__db(self): rc = CapabilityTypeDAOFactory.create('db') - self.assertEquals(rc.get_type(), 'DBCapabilityTypeDAO') + self.assertEqual(rc.get_type(), 'DBCapabilityTypeDAO') def test_v1_resource_exists(self): v1 = V1Controller() @@ -79,15 +79,15 @@ class TestControllerV1(base.TestCase): def test_v1_resource_dao_factory__memory(self): rc = ResourceDAOFactory.create('memory') - self.assertEquals(rc.get_type(), 'MemResourceDAO') + self.assertEqual(rc.get_type(), 'MemResourceDAO') def test_v1_resource_dao_factory__file(self): rc = ResourceDAOFactory.create('file') - self.assertEquals(rc.get_type(), 'FileResourceDAO') + self.assertEqual(rc.get_type(), 'FileResourceDAO') def test_v1_resource_dao_factory__db(self): rc = ResourceDAOFactory.create('db') - self.assertEquals(rc.get_type(), 'DBResourceDAO') + self.assertEqual(rc.get_type(), 'DBResourceDAO') def test_v1_resource_controller_factory__unknown(self): rc = ResourceDAOFactory.create('invalid_controller') diff --git a/tox.ini b/tox.ini index 9a82bc7..b345f48 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,7 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' # E123, E125 skipped as they are invalid PEP-8. show-source = True +select = H234 ignore = E123,E125,H803 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build