Assert image type by radarhere · Pull Request #8619 · python-pillow/Pillow
This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.
The test suite contains code like
Pillow/Tests/test_file_apng.py
Lines 14 to 15 in 0e3f51d
| with Image.open("Tests/images/apng/single_frame.png") as im: | |
| assert not im.is_animated |
But is_animated is not a property on a generic image, only on certain image formats. So this PR adds asserts to make sure the image are of the right format.