Skip to content

Commit 81be8d5

Browse files
authored
Fixed unclosed file warning (#8847)
1 parent 60b5131 commit 81be8d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/test_image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ def test_tempfile(self) -> None:
230230
assert_image_similar(im, reloaded, 20)
231231

232232
def test_unknown_extension(self, tmp_path: Path) -> None:
233-
im = hopper()
234233
temp_file = tmp_path / "temp.unknown"
235-
with pytest.raises(ValueError):
236-
im.save(temp_file)
234+
with hopper() as im:
235+
with pytest.raises(ValueError):
236+
im.save(temp_file)
237237

238238
def test_internals(self) -> None:
239239
im = Image.new("L", (100, 100))

0 commit comments

Comments
 (0)