From 0b73330f7cfdc260b1e3e28045c0550090065a0c Mon Sep 17 00:00:00 2001 From: ygd58 Date: Fri, 31 Jul 2026 13:18:13 +0000 Subject: [PATCH] test(update): strengthen UnicodeDecodeError regression to assert_not_called() Follow-up per review of #74631. The prior assertion (call_count == 0 OR interactive != True) also passed if an unintended non-interactive migration occurred, which the safe fallback (response='n') is supposed to prevent entirely. Replaced with mock_migrate.assert_not_called(). 6/6 pass in the full tests/hermes_cli/test_update_yes_flag.py file. --- tests/hermes_cli/test_update_yes_flag.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/hermes_cli/test_update_yes_flag.py b/tests/hermes_cli/test_update_yes_flag.py index 1e10ddb5d3496..20d99e8b08165 100644 --- a/tests/hermes_cli/test_update_yes_flag.py +++ b/tests/hermes_cli/test_update_yes_flag.py @@ -181,9 +181,7 @@ class TestUnicodeDecodeErrorInUpdatePrompts: out = capsys.readouterr().out assert "hermes config migrate" in out - assert mock_migrate.call_count == 0 or ( - mock_migrate.call_args and mock_migrate.call_args.kwargs.get("interactive") is not True - ) + mock_migrate.assert_not_called() def test_stash_restore_unicode_decode_error_falls_through_to_skip(self, tmp_path, capsys): from hermes_cli.update_cmd import _restore_stashed_changes