Skip to content

Commit

Permalink
Fix ruff/pyupgrade issues (UP032)
Browse files Browse the repository at this point in the history
UP032 Use f-string instead of `format` call

https://docs.astral.sh/ruff/rules/format-literals/
  • Loading branch information
DimitriPapadopoulos committed Mar 6, 2024
1 parent c2a46a3 commit f22e864
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions capsul/test/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
capsul_src = Path(__file__).parent.parent
if args.html:
Path(args.html).mkdir(exist_ok=True)
pytest_command += ["--cov=capsul", "--html={}/tests.html".format(args.html)]
pytest_command += ["--cov=capsul", f"--html={args.html}/tests.html"]
coverage_command = [sys.executable, "-m", "coverage", "html", "-d", args.html]
env = os.environ.copy()
print(" ".join("'{}'".format(i) for i in pytest_command))
print(" ".join(f"'{i}'" for i in pytest_command))
subprocess.check_call(pytest_command, env=env, cwd=capsul_src)
print(" ".join("'{}'".format(i) for i in coverage_command))
print(" ".join(f"'{i}'" for i in coverage_command))
subprocess.check_call(coverage_command)
else:
print(" ".join("'{}'".format(i) for i in pytest_command))
print(" ".join(f"'{i}'" for i in pytest_command))
subprocess.check_call(pytest_command, cwd=capsul_src)
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ ignore = [
"E501",
"UP015",
"UP031",
"UP032",
# https://docs.astral.sh/ruff/rules/redundant-open-modes/
# we prefer explicit to implicit open modes
"UP015",
Expand Down

0 comments on commit f22e864

Please sign in to comment.