From: Cyril Roelandt Date: Wed, 15 Jul 2015 11:54:51 +0000 (+0000) Subject: Python 3: do not use types.ClassType X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e2fb74e1964a2f9cb1777c8f8a34a70f1b733be0;p=openstack-build%2Fneutron-build.git Python 3: do not use types.ClassType In Python 3, one should just use 'type'. Still, the use of "ClassType" does not seem necessary here, so just fix the tests. Change-Id: I5574926fc338110cc989bf185fa454ec26f4d530 Blueprint: neutron-python3 --- diff --git a/neutron/tests/unit/ipam/test_requests.py b/neutron/tests/unit/ipam/test_requests.py index 8fd014c09..e15f3a7f4 100644 --- a/neutron/tests/unit/ipam/test_requests.py +++ b/neutron/tests/unit/ipam/test_requests.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import types - import mock import netaddr from oslo_config import cfg @@ -277,7 +275,7 @@ class TestIpamDriverLoader(base.BaseTestCase): def test_ipam_driver_is_loaded_from_ipam_driver_config_value(self): ipam_driver = self._load_ipam_driver('fake', None) self.assertIsInstance( - ipam_driver, (fake_driver.FakeDriver, types.ClassType), + ipam_driver, fake_driver.FakeDriver, "loaded ipam driver should be of type FakeDriver") @mock.patch(FAKE_IPAM_CLASS) diff --git a/neutron/tests/unit/test_manager.py b/neutron/tests/unit/test_manager.py index 59ecb58a8..b3d3916f9 100644 --- a/neutron/tests/unit/test_manager.py +++ b/neutron/tests/unit/test_manager.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -import types - import fixtures from oslo_config import cfg from oslo_log import log as logging @@ -56,7 +54,7 @@ class NeutronManagerTestCase(base.BaseTestCase): plugin = mgr.get_service_plugins()[constants.DUMMY] self.assertIsInstance( - plugin, (dummy_plugin.DummyServicePlugin, types.ClassType), + plugin, dummy_plugin.DummyServicePlugin, "loaded plugin should be of type neutronDummyPlugin") def test_service_plugin_by_name_is_loaded(self): @@ -66,7 +64,7 @@ class NeutronManagerTestCase(base.BaseTestCase): plugin = mgr.get_service_plugins()[constants.DUMMY] self.assertIsInstance( - plugin, (dummy_plugin.DummyServicePlugin, types.ClassType), + plugin, dummy_plugin.DummyServicePlugin, "loaded plugin should be of type neutronDummyPlugin") def test_multiple_plugins_specified_for_service_type(self): diff --git a/tox.ini b/tox.ini index 292aa1222..8ff3b2d70 100644 --- a/tox.ini +++ b/tox.ini @@ -195,6 +195,7 @@ commands = python -m testtools.run \ neutron.tests.unit.agent.linux.test_bridge_lib \ neutron.tests.unit.agent.linux.test_ip_link_support \ neutron.tests.unit.agent.linux.test_interface \ + neutron.tests.unit.test_manager \ neutron.tests.unit.test_auth \ neutron.tests.unit.test_policy \ neutron.tests.unit.extensions.v2attributes \