From f9a4c92993822a1b06f665285d947dacb6c8dccc Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Mon, 11 Sep 2023 08:35:11 -0300 Subject: [PATCH] Use self.assertIsInstance() Replace "assert type(...) is Foo" with "self.assertIsInstance(..., Foo)" this produces a more meaningful test error message and fixes pep8 rule E721[0] [0] https://www.flake8rules.com/rules/E721.html --- zaza/openstack/charm_tests/ceilometer/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ceilometer/tests.py b/zaza/openstack/charm_tests/ceilometer/tests.py index a9b704b..6532b35 100644 --- a/zaza/openstack/charm_tests/ceilometer/tests.py +++ b/zaza/openstack/charm_tests/ceilometer/tests.py @@ -126,7 +126,7 @@ class CeilometerTest(test_utils.OpenStackBaseTest): current_value = openstack_utils.get_application_config_option( self.application_name, config_name ) - assert type(current_value) is bool + self.assertIsInstance(current_value, bool) new_value = not current_value # Convert bool to str