mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 17:54:32 +03:00
Use context manager
This commit is contained in:
parent
3e9403af56
commit
17c48db318
|
@ -2,8 +2,8 @@ from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
def test_getxmp():
|
def test_getxmp():
|
||||||
im = Image.open("Tests/images/xmp_test.jpg")
|
with Image.open("Tests/images/xmp_test.jpg") as im:
|
||||||
type_repr = repr(type(im.getxmp()))
|
type_repr = repr(type(im.getxmp()))
|
||||||
|
|
||||||
assert "dict" in type_repr
|
assert "dict" in type_repr
|
||||||
assert isinstance(im.getxmp()["Description"][0]["Version"], str)
|
assert isinstance(im.getxmp()["Description"][0]["Version"], str)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user