mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Added context managers
This commit is contained in:
parent
0f11d22cce
commit
1b397751ec
|
@ -895,8 +895,8 @@ class TestFileJpeg:
|
|||
|
||||
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")
|
||||
|
|
|
@ -108,5 +108,5 @@ def test_save_stdout(buffer):
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user