Skip to content

Commit

Permalink
Use f-strings in engine/util.py (#10288)
Browse files Browse the repository at this point in the history
  • Loading branch information
asherf committed Jul 8, 2020
1 parent d60cde2 commit d652e60
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/python/pants/testutil/engine/util.py
Expand Up @@ -147,16 +147,12 @@ def run_rule(

if rule_args is not None and len(rule_args) != len(task_rule.input_selectors):
raise ValueError(
"Rule expected to receive arguments of the form: {}; got: {}".format(
task_rule.input_selectors, rule_args
)
f"Rule expected to receive arguments of the form: {task_rule.input_selectors}; got: {rule_args}"
)

if mock_gets is not None and len(mock_gets) != len(task_rule.input_gets):
raise ValueError(
"Rule expected to receive Get providers for {}; got: {}".format(
task_rule.input_gets, mock_gets
)
f"Rule expected to receive Get providers for {task_rule.input_gets}; got: {mock_gets}"
)

res = rule(*(rule_args or ()))
Expand All @@ -181,9 +177,7 @@ def get(product, subject):
)
if provider is None:
raise AssertionError(
"Rule requested: Get{}, which cannot be satisfied.".format(
(product, type(subject), subject)
)
f"Rule requested: Get{(product, type(subject), subject)}, which cannot be satisfied."
)
return provider(subject)

Expand Down

0 comments on commit d652e60

Please sign in to comment.