Skip to content

Commit

Permalink
Use self.assertIsInstance()
Browse files Browse the repository at this point in the history
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

(cherry picked from commit f9a4c92)
  • Loading branch information
freyes committed Sep 11, 2023
1 parent b3b367a commit db4ac64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zaza/openstack/charm_tests/ceilometer/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_900_restart_on_config_change(self):
current_value = openstack_utils.get_application_config_option(
self.application_name, config_name
)
assert type(current_value) == bool
self.assertIsInstance(current_value, bool)
new_value = not current_value

# Convert bool to str
Expand Down

0 comments on commit db4ac64

Please sign in to comment.