From 5fdb598bc4d4115f86584d5fb7c0389d7639276f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 14 Feb 2024 08:57:57 +0000 Subject: [PATCH] Run `pyupgrade` against the files modified in the merge-forward --- tests/integration/cli/test_custom_module.py | 2 +- tests/integration/ssh/test_state.py | 2 +- tests/pytests/functional/states/test_npm.py | 2 +- tests/pytests/integration/states/test_ansiblegate.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/cli/test_custom_module.py b/tests/integration/cli/test_custom_module.py index 2d0ea870167..ec8415424e7 100644 --- a/tests/integration/cli/test_custom_module.py +++ b/tests/integration/cli/test_custom_module.py @@ -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) diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index 48f634f309f..2392d79c940 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -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"], diff --git a/tests/pytests/functional/states/test_npm.py b/tests/pytests/functional/states/test_npm.py index 500bd274498..81dd00f5544 100644 --- a/tests/pytests/functional/states/test_npm.py +++ b/tests/pytests/functional/states/test_npm.py @@ -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") diff --git a/tests/pytests/integration/states/test_ansiblegate.py b/tests/pytests/integration/states/test_ansiblegate.py index 0b70a7ab138..ef08768b1c7 100644 --- a/tests/pytests/integration/states/test_ansiblegate.py +++ b/tests/pytests/integration/states/test_ansiblegate.py @@ -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