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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user