From 06b7b97a7aa771761d746e5a6fe424b543baa231 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 30 Dec 2020 22:39:49 +1100 Subject: [PATCH] Use isinstance to check type --- Tests/test_image_getxmp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/test_image_getxmp.py b/Tests/test_image_getxmp.py index 2ca7f0fde..33c531931 100644 --- a/Tests/test_image_getxmp.py +++ b/Tests/test_image_getxmp.py @@ -3,7 +3,8 @@ from PIL import Image def test_getxmp(): with Image.open("Tests/images/xmp_test.jpg") as im: - type_repr = repr(type(im.getxmp())) + xmp = im.getxmp() + + assert isinstance(xmp, dict) + assert isinstance(xmp["Description"][0]["Version"], str) - assert "dict" in type_repr - assert isinstance(im.getxmp()["Description"][0]["Version"], str)