Fixed unclosed file warning ()

This commit is contained in:
Andrew Murray 2025-03-31 05:16:25 +11:00 committed by GitHub
parent 60b5131e9f
commit 81be8d5410
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -230,10 +230,10 @@ class TestImage:
assert_image_similar(im, reloaded, 20)
def test_unknown_extension(self, tmp_path: Path) -> None:
im = hopper()
temp_file = tmp_path / "temp.unknown"
with pytest.raises(ValueError):
im.save(temp_file)
with hopper() as im:
with pytest.raises(ValueError):
im.save(temp_file)
def test_internals(self) -> None:
im = Image.new("L", (100, 100))