mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 01:34:24 +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():
|
||||
im = Image.open("Tests/images/xmp_test.jpg")
|
||||
type_repr = repr(type(im.getxmp()))
|
||||
with Image.open("Tests/images/xmp_test.jpg") as im:
|
||||
type_repr = repr(type(im.getxmp()))
|
||||
|
||||
assert "dict" in type_repr
|
||||
assert isinstance(im.getxmp()["Description"][0]["Version"], str)
|
||||
assert "dict" in type_repr
|
||||
assert isinstance(im.getxmp()["Description"][0]["Version"], str)
|
||||
|
|
Loading…
Reference in New Issue
Block a user