Skip to content

The agent that grows with you

test(backup): capture duplicate zip warning

JoaoMarcos443a692eb45e33
diff --git a/tests/hermes_cli/test_backup.py b/tests/hermes_cli/test_backup.py
index 272120c3cc6..21f9222f043 100644
--- a/tests/hermes_cli/test_backup.py
+++ b/tests/hermes_cli/test_backup.py
@@ -1823,8 +1823,9 @@ class TestFailedZipMemberRecovery:
with zipfile.ZipFile(archive, "w", zipfile.ZIP_DEFLATED) as zf:
zf.writestr("dup.bin", b"complete-before-failure")
- with pytest.raises(OSError, match="simulated source read failure"):
- backup_mod._write_zip_file(zf, source, "dup.bin")
+ with pytest.warns(UserWarning, match="Duplicate name"):
+ with pytest.raises(OSError, match="simulated source read failure"):
+ backup_mod._write_zip_file(zf, source, "dup.bin")
zf.writestr("after.bin", b"after")
assert archive.stat().st_size > 65_535