mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-09 14:54:46 +03:00
test lack of warnings from common mode conversions
This commit is contained in:
parent
0568292553
commit
8bdb6553a4
|
@ -168,6 +168,21 @@ class TestImage:
|
|||
assert im2.size == (1500, 1500)
|
||||
assert_image_equal(im.resize(im2.size), im2)
|
||||
|
||||
# make sure common modes get converted without a warning
|
||||
im = Image.new("LAB", (100, 100))
|
||||
with pytest.warns(None) as record:
|
||||
bundle = im._repr_mimebundle_()
|
||||
assert len(record) == 0
|
||||
with Image.open(io.BytesIO(bundle["image/png"])) as im2:
|
||||
assert_image_equal(im.convert("RGB"), im2)
|
||||
|
||||
im = Image.new("HSV", (100, 100))
|
||||
with pytest.warns(None) as record:
|
||||
bundle = im._repr_mimebundle_()
|
||||
assert len(record) == 0
|
||||
with Image.open(io.BytesIO(bundle["image/png"])) as im2:
|
||||
assert_image_equal(im.convert("RGB"), im2)
|
||||
|
||||
def test_open_formats(self):
|
||||
PNGFILE = "Tests/images/hopper.png"
|
||||
JPGFILE = "Tests/images/hopper.jpg"
|
||||
|
|
Loading…
Reference in New Issue
Block a user