Various string cleanups (#30435)

* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2020-01-03 14:47:06 +01:00
1 parent 5ad209c6fd
commit fa4fa30461
105 files changed
+241 -314

No files matched your search

+4 -5
View File
@@ -38,12 +38,11 @@ def assert_state_equals(
entity_id = get_entity_id(measure, profile)
state_obj = hass.states.get(entity_id)
assert state_obj, "Expected entity {} to exist but it did not".format(entity_id)
assert state_obj, f"Expected entity {entity_id} to exist but it did not"
assert state_obj.state == str(
expected
), "Expected {} but was {} for measure {}, {}".format(
expected, state_obj.state, measure, entity_id
assert state_obj.state == str(expected), (
f"Expected {expected} but was {state_obj.state} "
f"for measure {measure}, {entity_id}"
)