mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Apply pyupgrade
on the changed files from the merge-forward
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
830daeee97
commit
8f7d96b593
3 changed files with 7 additions and 9 deletions
|
@ -58,7 +58,7 @@ def _pip_successful_install(
|
|||
)
|
||||
|
||||
success_for = (
|
||||
re.findall(r"({})(?:-(?:[\d\.-]))?".format(expect_str), success.groups()[0])
|
||||
re.findall(rf"({expect_str})(?:-(?:[\d\.-]))?", success.groups()[0])
|
||||
if success
|
||||
else []
|
||||
)
|
||||
|
@ -540,7 +540,7 @@ def test_pip_install_multiple_editables(venv_dir, salt_cli, salt_minion):
|
|||
assert ret.returncode == 0
|
||||
for package in ("iStr", "SaltTesting"):
|
||||
match = re.search(
|
||||
r"(?:.*)(Successfully installed)(?:.*)({})(?:.*)".format(package),
|
||||
rf"(?:.*)(Successfully installed)(?:.*)({package})(?:.*)",
|
||||
ret.stdout,
|
||||
)
|
||||
assert match is not None
|
||||
|
@ -580,7 +580,7 @@ def test_pip_install_multiple_editables_and_pkgs(venv_dir, salt_cli, salt_minion
|
|||
assert ret.returncode == 0
|
||||
for package in ("iStr", "SaltTesting", "pep8"):
|
||||
match = re.search(
|
||||
r"(?:.*)(Successfully installed)(?:.*)({})(?:.*)".format(package),
|
||||
rf"(?:.*)(Successfully installed)(?:.*)({package})(?:.*)",
|
||||
ret.stdout,
|
||||
)
|
||||
assert match is not None
|
||||
|
|
|
@ -25,7 +25,7 @@ def test_function():
|
|||
"name": name,
|
||||
"changes": {},
|
||||
"result": None,
|
||||
"comment": "Function state would be executed on target {}".format(tgt),
|
||||
"comment": f"Function state would be executed on target {tgt}",
|
||||
}
|
||||
|
||||
with patch.dict(saltmod.__opts__, {"test": True}):
|
||||
|
@ -36,9 +36,7 @@ def test_function():
|
|||
{
|
||||
"result": True,
|
||||
"changes": {"ret": {tgt: ""}},
|
||||
"comment": (
|
||||
"Function ran successfully. Function state ran on {}.".format(tgt)
|
||||
),
|
||||
"comment": (f"Function ran successfully. Function state ran on {tgt}."),
|
||||
}
|
||||
)
|
||||
with patch.dict(saltmod.__opts__, {"test": False}):
|
||||
|
|
|
@ -55,7 +55,7 @@ def test_clean_path_symlinked_src(setup_links):
|
|||
test_path = from_path / "test"
|
||||
expect_path = str(to_path / "test")
|
||||
ret = salt.utils.verify.clean_path(str(from_path), str(test_path))
|
||||
assert ret == expect_path, "{} is not {}".format(ret, expect_path)
|
||||
assert ret == expect_path, f"{ret} is not {expect_path}"
|
||||
|
||||
|
||||
def test_clean_path_symlinked_tgt(setup_links):
|
||||
|
@ -63,4 +63,4 @@ def test_clean_path_symlinked_tgt(setup_links):
|
|||
test_path = to_path / "test"
|
||||
expect_path = str(to_path / "test")
|
||||
ret = salt.utils.verify.clean_path(str(from_path), str(test_path))
|
||||
assert ret == expect_path, "{} is not {}".format(ret, expect_path)
|
||||
assert ret == expect_path, f"{ret} is not {expect_path}"
|
||||
|
|
Loading…
Add table
Reference in a new issue