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:
1 parent
5ad209c6fd
commit
fa4fa30461
105 files changed
+241
-314
No files matched your search
@@ -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}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user