Run pyupgrade against the files modified in the merge-forward

This commit is contained in:
Pedro Algarvio 2024-02-14 08:57:57 +00:00
parent fd800f57f1
commit 5fdb598bc4
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
4 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@ class SSHCustomModuleTest(SSHCase):
cmd = self.run_function("state.sls", arg=["custom_module"])
for key in cmd:
if not isinstance(cmd, dict) or not isinstance(cmd[key], dict):
raise AssertionError("{} is not a proper state return".format(cmd))
raise AssertionError(f"{cmd} is not a proper state return")
elif not cmd[key]["result"]:
raise AssertionError(cmd[key]["comment"])
cmd_ret = cmd[key]["changes"].get("ret", None)

View file

@ -35,7 +35,7 @@ class SSHStateTest(SSHCase):
def _check_request(self, empty=False):
check = self.run_function("state.check_request", wipe=False)
if empty:
self.assertFalse(bool(check), "bool({}) is not False".format(check))
self.assertFalse(bool(check), f"bool({check}) is not False")
else:
self._check_dict_ret(
ret=check["default"]["test_run"]["local"]["return"],

View file

@ -23,7 +23,7 @@ def install_npm(states):
# Just name the thing we're looking for
states.npm # pylint: disable=pointless-statement
except (CommandExecutionError, AttributeError, AssertionError) as exc:
pytest.skip("Unable to install npm - {}".format(exc))
pytest.skip(f"Unable to install npm - {exc}")
@pytest.fixture(scope="module")

View file

@ -118,7 +118,7 @@ def test_ansible_playbook(salt_call_cli, ansible_inventory, tmp_path):
except FactoryTimeout:
log.debug("%s took longer than %s seconds", name, timeout)
if timeout == timeouts[-1]:
pytest.fail("Failed to run {}".format(name))
pytest.fail(f"Failed to run {name}")
else:
assert ret.returncode == 0
assert StateResult(ret.data).result is True