mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44: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():
|
def test_transparent_dispose():
|
||||||
img = Image.open("Tests/images/transparent_dispose.gif")
|
|
||||||
|
|
||||||
expected_colors = [(2, 1, 2), (0, 1, 0), (2, 1, 2)]
|
expected_colors = [(2, 1, 2), (0, 1, 0), (2, 1, 2)]
|
||||||
for frame in range(3):
|
with Image.open("Tests/images/transparent_dispose.gif") as img:
|
||||||
img.seek(frame)
|
for frame in range(3):
|
||||||
for x in range(3):
|
img.seek(frame)
|
||||||
color = img.getpixel((x, 0))
|
for x in range(3):
|
||||||
assert color == expected_colors[frame][x]
|
color = img.getpixel((x, 0))
|
||||||
|
assert color == expected_colors[frame][x]
|
||||||
|
|
||||||
|
|
||||||
def test_dispose_previous():
|
def test_dispose_previous():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user