Only add test to PPM

This commit is contained in:
Andrew Murray 2021-11-25 23:33:59 +11:00
parent 1b397751ec
commit 3a302f3e4b

View File

@ -1,6 +1,5 @@
import os
import re
import sys
from io import BytesIO
import pytest
@ -871,33 +870,6 @@ class TestFileJpeg:
with Image.open("Tests/images/hopper.jpg") as im:
assert im.getxmp() == {}
@pytest.mark.parametrize("buffer", (True, False))
def test_save_stdout(self, buffer):
old_stdout = sys.stdout
if buffer:
class MyStdOut:
buffer = BytesIO()
mystdout = MyStdOut()
else:
mystdout = BytesIO()
sys.stdout = mystdout
with Image.open(TEST_FILE) as im:
im.save(sys.stdout, "JPEG")
im_roundtrip = self.roundtrip(im)
# Reset stdout
sys.stdout = old_stdout
if buffer:
mystdout = mystdout.buffer
with Image.open(mystdout) as reloaded:
assert_image_equal(reloaded, im_roundtrip)
@pytest.mark.skipif(not is_win32(), reason="Windows only")
@skip_unless_feature("jpg")