mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Merge pull request #1 from radarhere/jpg_repr
Only assert image is similar
This commit is contained in:
commit
55be23bbd2
|
@ -922,18 +922,18 @@ class TestFileJpeg:
|
||||||
im.load()
|
im.load()
|
||||||
ImageFile.LOAD_TRUNCATED_IMAGES = False
|
ImageFile.LOAD_TRUNCATED_IMAGES = False
|
||||||
|
|
||||||
def test_repr_jpg(self):
|
def test_repr_jpeg(self):
|
||||||
im = hopper()
|
im = hopper()
|
||||||
|
|
||||||
with Image.open(BytesIO(im._repr_jpg_())) as repr_jpg:
|
with Image.open(BytesIO(im._repr_jpeg_())) as repr_jpeg:
|
||||||
assert repr_jpg.format == "JPEG"
|
assert repr_jpeg.format == "JPEG"
|
||||||
assert_image_equal(im, repr_jpg)
|
assert_image_similar(im, repr_jpeg, 17)
|
||||||
|
|
||||||
def test_repr_jpg_error(self):
|
def test_repr_jpeg_error(self):
|
||||||
im = hopper("F")
|
im = hopper("F")
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
im._repr_jpg_()
|
im._repr_jpeg_()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not is_win32(), reason="Windows only")
|
@pytest.mark.skipif(not is_win32(), reason="Windows only")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user