Skip to content

Commit bce03fb

Browse files
committed
Using fstrings
1 parent 851023f commit bce03fb

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/stepfunctions/steps/states.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,7 @@ def next(self, next_step):
226226
# See language spec for more info: https://states-language.net/spec.html#choice-state
227227
if self.type is 'Choice':
228228
if self.default is not None:
229-
logger.warning(
230-
"Chaining Choice state: Overwriting %s's current default_choice (%s) with %s",
231-
self.state_id,
232-
self.default.state_id,
233-
next_step.state_id
234-
)
229+
logger.warning(f'Chaining Choice state: Overwriting {self.state_id}\'s current default_choice ({self.default.state_id}) with {next_step.state_id}')
235230
self.default_choice(next_step)
236231
return self.default
237232

tests/unit/test_steps.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,7 @@ def test_chaining_choice_with_existing_default_overrides_value(caplog):
391391
# Chain s2_choice when default_choice is already set will trigger Warning
392392
with caplog.at_level(logging.WARNING):
393393
Chain([s2_choice, s1_pass])
394-
expected_warning = (
395-
"Chaining Choice state: Overwriting %s's current default_choice (%s) with %s" %
396-
(s2_choice.state_id, s3_pass.state_id, s1_pass.state_id)
397-
)
394+
expected_warning = f'Chaining Choice state: Overwriting {s2_choice.state_id}\'s current default_choice ({s3_pass.state_id}) with {s1_pass.state_id}'
398395
assert expected_warning in caplog.text
399396
assert 'WARNING' in caplog.text
400397
assert s2_choice.default == s1_pass

0 commit comments

Comments
 (0)