Added context manager

This commit is contained in:
Andrew Murray 2021-02-02 23:39:53 +11:00
parent 023dbe3925
commit 63f21609c0

View File

@ -571,8 +571,8 @@ class TestFilePng:
assert len(chunks) == 3 assert len(chunks) == 3
def test_read_private_chunks(self): def test_read_private_chunks(self):
im = Image.open("Tests/images/exif.png") with Image.open("Tests/images/exif.png") as im:
assert im.private_chunks == [(b"orNT", b"\x01")] assert im.private_chunks == [(b"orNT", b"\x01")]
def test_roundtrip_private_chunk(self): def test_roundtrip_private_chunk(self):
# Check private chunk roundtripping # Check private chunk roundtripping