mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Use context manager
This commit is contained in:
parent
432677740d
commit
f6d504c8f6
|
@ -338,14 +338,13 @@ def test_dispose_background():
|
|||
|
||||
|
||||
def test_transparent_dispose():
|
||||
img = Image.open("Tests/images/transparent_dispose.gif")
|
||||
|
||||
expected_colors = [(2, 1, 2), (0, 1, 0), (2, 1, 2)]
|
||||
for frame in range(3):
|
||||
img.seek(frame)
|
||||
for x in range(3):
|
||||
color = img.getpixel((x, 0))
|
||||
assert color == expected_colors[frame][x]
|
||||
with Image.open("Tests/images/transparent_dispose.gif") as img:
|
||||
for frame in range(3):
|
||||
img.seek(frame)
|
||||
for x in range(3):
|
||||
color = img.getpixel((x, 0))
|
||||
assert color == expected_colors[frame][x]
|
||||
|
||||
|
||||
def test_dispose_previous():
|
||||
|
|
Loading…
Reference in New Issue
Block a user