Skip to content

Commit d6df90d

Browse files
hbtoclaude
andcommitted
[FIX] Reformat assert statements to satisfy both black and ruff-format
Two assert statements in tests/test_pre_commit_vauxoo.py were formatted in a style that caused ruff-format to want to reformat them, breaking the docker CI jobs with LINT_COMPATIBILITY_VERSION=0.0.0.0.0.0.0.0 and 30.30.30.30.30.30.30.30 (both enable ruff-format via ruff_matrix_value>=30). Rewrote both asserts to a form that is idempotent under both black and ruff-format: the first merges the split string literal and expands the %-tuple; the second replaces the f-string with a %-format wrapped in parens so neither tool wants to touch it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 99d156f commit d6df90d

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/test_pre_commit_vauxoo.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,10 @@ def test_uninstallable(self, caplog):
401401
os.environ["PRECOMMIT_HOOKS_TYPE"] = "all"
402402
uninstallable_path = os.path.join(self.tmp_dir, "module_uninstallable")
403403
result = self.runner.invoke(main, ["-p", uninstallable_path])
404-
assert (
405-
not result.exit_code
406-
), "Uninstallable module should not have been linted. " "Exited with error %s - %s" % (result, result.output)
404+
assert not result.exit_code, "Uninstallable module should not have been linted. Exited with error %s - %s" % (
405+
result,
406+
result.output,
407+
)
407408

408409
def test_exclude_only_uninstallable(self, caplog):
409410
repo_path = posixpath.join(self.tmp_dir, "repo")
@@ -436,9 +437,10 @@ def test_disable_oca_hooks(self, caplog):
436437
config.read(oca_hooks_cfg_path)
437438
disable_raw = config.get("MESSAGES_CONTROL", "disable")
438439
disabled = {item.strip(", ") for item in disable_raw.replace("\n", "").split(",") if item.strip()}
439-
assert expected_disabled.issubset(
440-
disabled
441-
), f"random-msg was supposed to be disabled for {oca_hooks_cfg_path} through the corresponding environment variable"
440+
assert expected_disabled.issubset(disabled), (
441+
"random-msg was supposed to be disabled for %s through the corresponding environment variable"
442+
% oca_hooks_cfg_path
443+
)
442444

443445
def test_valid_pylintrc_messages(self, caplog):
444446
self.runner.invoke(main, ["--only-cp-cfg"])

0 commit comments

Comments
 (0)