diff --git a/oslo_messaging/tests/drivers/test_amqp_driver.py b/oslo_messaging/tests/drivers/test_amqp_driver.py index d1ca36ce7..cc1202cf6 100644 --- a/oslo_messaging/tests/drivers/test_amqp_driver.py +++ b/oslo_messaging/tests/drivers/test_amqp_driver.py @@ -1337,10 +1337,10 @@ class TestAddressing(test_utils.BaseTestCase): # simply check that the correct addresser is provided based on the # identity of the messaging back-end self.config(addressing_mode='dynamic', group="oslo_messaging_amqp") - self.assertTrue(isinstance(self._dynamic_test("router"), - RoutableAddresser)) - self.assertTrue(isinstance(self._dynamic_test("qpid-cpp"), - LegacyAddresser)) + self.assertIsInstance(self._dynamic_test("router"), + RoutableAddresser) + self.assertIsInstance(self._dynamic_test("qpid-cpp"), + LegacyAddresser) class FakeBroker(threading.Thread): diff --git a/oslo_messaging/tests/drivers/zmq/test_zmq_async.py b/oslo_messaging/tests/drivers/zmq/test_zmq_async.py index 702e39b4b..5d8159deb 100644 --- a/oslo_messaging/tests/drivers/zmq/test_zmq_async.py +++ b/oslo_messaging/tests/drivers/zmq/test_zmq_async.py @@ -59,14 +59,14 @@ class TestGetPoller(test_utils.BaseTestCase): poller = zmq_async.get_poller() - self.assertTrue(isinstance(poller, green_poller.GreenPoller)) + self.assertIsInstance(poller, green_poller.GreenPoller) def test_when_eventlet_is_unavailable_then_return_ThreadingPoller(self): zmq_async.eventletutils.is_monkey_patched = lambda _: False poller = zmq_async.get_poller() - self.assertTrue(isinstance(poller, threading_poller.ThreadingPoller)) + self.assertIsInstance(poller, threading_poller.ThreadingPoller) class TestGetExecutor(test_utils.BaseTestCase): @@ -80,7 +80,7 @@ class TestGetExecutor(test_utils.BaseTestCase): executor = zmq_async.get_executor('any method') - self.assertTrue(isinstance(executor, green_poller.GreenExecutor)) + self.assertIsInstance(executor, green_poller.GreenExecutor) self.assertEqual('any method', executor._method) def test_when_eventlet_is_unavailable_then_return_ThreadingExecutor(self): @@ -88,6 +88,6 @@ class TestGetExecutor(test_utils.BaseTestCase): executor = zmq_async.get_executor('any method') - self.assertTrue(isinstance(executor, - threading_poller.ThreadingExecutor)) + self.assertIsInstance(executor, + threading_poller.ThreadingExecutor) self.assertEqual('any method', executor._method) diff --git a/oslo_messaging/tests/test_config_opts_proxy.py b/oslo_messaging/tests/test_config_opts_proxy.py index e51794cf4..0733c5363 100644 --- a/oslo_messaging/tests/test_config_opts_proxy.py +++ b/oslo_messaging/tests/test_config_opts_proxy.py @@ -51,8 +51,8 @@ class TestConfigOptsProxy(test_utils.BaseTestCase): self.assertRaises(cfg.NoSuchOptError, conf.__getattr__, 'unknown_group') - self.assertTrue(isinstance(getattr(conf, group), - conf.GroupAttrProxy)) + self.assertIsInstance(getattr(conf, group), + conf.GroupAttrProxy) self.assertEqual(1, conf.oslo_messaging_rabbit.rabbit_retry_interval) self.assertEqual(2, conf.oslo_messaging_rabbit.rabbit_qos_prefetch_count)