diff --git a/Tests/helper.py b/Tests/helper.py index 3da2571f25e..fe231f3e6b2 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -278,6 +278,11 @@ def is_big_endian(): return sys.byteorder == "big" +def is_ppc64le(): + import platform + return platform.machine() == "ppc64le" + + def is_win32(): return sys.platform.startswith("win32") diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py index f585a06699d..f434d96afb2 100644 --- a/Tests/test_file_eps.py +++ b/Tests/test_file_eps.py @@ -4,7 +4,7 @@ from PIL import EpsImagePlugin, Image, features -from .helper import assert_image_similar, hopper, skip_unless_feature +from .helper import assert_image_similar, hopper, is_ppc64le, skip_unless_feature HAS_GHOSTSCRIPT = EpsImagePlugin.has_ghostscript() @@ -59,6 +59,7 @@ def test_invalid_file(): EpsImagePlugin.EpsImageFile(invalid_file) +@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA") @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available") def test_cmyk(): with Image.open("Tests/images/pil_sample_cmyk.eps") as cmyk_image: @@ -75,6 +76,7 @@ def test_cmyk(): assert_image_similar(cmyk_image, target, 10) +@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA") @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available") def test_showpage(): # See https://github.com/python-pillow/Pillow/issues/2615 @@ -102,6 +104,7 @@ def test_iobase_object(tmp_path): image1.save(fh, "EPS") +@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA") @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available") def test_bytesio_object(): with open(FILE1, "rb") as f: @@ -123,6 +126,7 @@ def test_image_mode_not_supported(tmp_path): im.save(tmpfile) +@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA") @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available") @skip_unless_feature("zlib") def test_render_scale1(): @@ -145,6 +149,7 @@ def test_render_scale1(): assert_image_similar(image2_scale1, image2_scale1_compare, 10) +@pytest.mark.xfail(is_ppc64le(), reason="failing on ppc64le on GHA") @pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available") @skip_unless_feature("zlib") def test_render_scale2(): diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index b4107e8e3a6..b8356e2f80f 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -10,6 +10,7 @@ assert_image_similar, fromstring, hopper, + is_ppc64le, skip_unless_feature, tostring, ) @@ -57,7 +58,7 @@ def roundtrip(format): assert_image_equal(*roundtrip("TGA")) assert_image_equal(*roundtrip("PCX")) - if EpsImagePlugin.has_ghostscript(): + if EpsImagePlugin.has_ghostscript() and not is_ppc64le(): im1, im2 = roundtrip("EPS") # This test fails on Ubuntu 12.04, PPC (Bigendian) It # appears to be a ghostscript 9.05 bug, since the @@ -65,6 +66,9 @@ def roundtrip(format): # to that written on ubuntu 12.04 x64 # md5sum: ba974835ff2d6f3f2fd0053a23521d4a + # This test is also failing on PPC little endian on GHA, + # but not on Travis CI + # EPS comes back in RGB: assert_image_similar(im1, im2.convert("L"), 20)