Skip to content

Commit

Permalink
Added context managers
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Aug 24, 2021
1 parent 0f11d22 commit 1b39775
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Tests/test_file_jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,8 @@ class MyStdOut:

if buffer:
mystdout = mystdout.buffer
reloaded = Image.open(mystdout)
assert_image_equal(reloaded, im_roundtrip)
with Image.open(mystdout) as reloaded:
assert_image_equal(reloaded, im_roundtrip)


@pytest.mark.skipif(not is_win32(), reason="Windows only")
Expand Down
4 changes: 2 additions & 2 deletions Tests/test_file_ppm.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ class MyStdOut:

if buffer:
mystdout = mystdout.buffer
reloaded = Image.open(mystdout)
assert_image_equal_tofile(reloaded, TEST_FILE)
with Image.open(mystdout) as reloaded:
assert_image_equal_tofile(reloaded, TEST_FILE)

0 comments on commit 1b39775

Please sign in to comment.