Merge pull request #5244 from radarhere/unclosed_file

Fixed unclosed file warning
This commit is contained in:
Hugo van Kemenade 2021-02-02 15:11:06 +02:00 committed by GitHub
commit 31f3f8f793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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