Skip to content

Commit 67f5e5d

Browse files
committed
Test an empty string comment in arguments removes existing comment
1 parent db76eaa commit 67f5e5d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Tests/test_file_gif.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -853,15 +853,17 @@ def test_write_comment(tmp_path):
853853
)
854854

855855

856-
def test_write_no_comment(tmp_path):
856+
def test_empty_string_comment(tmp_path):
857857
out = str(tmp_path / "temp.gif")
858-
with Image.open("Tests/images/dispose_prev.gif") as im:
859-
# Empty comment="" arg should suppress all comments
858+
with Image.open("Tests/images/chi.gif") as im:
859+
assert "comment" in im.info
860+
861+
# Empty string comment should suppress existing comment
860862
im.save(out, save_all=True, comment="")
861-
with Image.open(out) as reread:
862-
assert "comment" not in reread.info
863-
for frame in ImageSequence.Iterator(reread):
864-
assert "comment" not in frame.info
863+
864+
with Image.open(out) as reread:
865+
for frame in ImageSequence.Iterator(reread):
866+
assert "comment" not in frame.info
865867

866868

867869
def test_version(tmp_path):

0 commit comments

Comments
 (0)