Skip to content

Commit f967638

Browse files
committed
1 parent ef4a0b2 commit f967638

8 files changed

Lines changed: 61 additions & 5 deletions

File tree

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@ notifications:
1313
matrix:
1414
fast_finish: true
1515
include:
16+
- python: "3.8"
17+
arch: arm64
18+
- python: "3.7"
19+
arch: arm64
20+
- python: "3.6"
21+
arch: arm64
22+
- python: "3.5"
23+
arch: arm64
24+
25+
- python: "3.8"
26+
arch: ppc64le
27+
- python: "3.7"
28+
arch: ppc64le
29+
- python: "3.6"
30+
arch: ppc64le
31+
- python: "3.5"
32+
arch: ppc64le
33+
34+
- python: "3.8"
35+
arch: s390x
36+
- python: "3.7"
37+
arch: s390x
38+
- python: "3.6"
39+
arch: s390x
40+
- python: "3.5"
41+
arch: s390x
42+
1643
- python: "3.6"
1744
name: "Lint"
1845
env: LINT="true"

.travis/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ pip install pyroma
1616
pip install test-image-results
1717
pip install numpy
1818
if [[ $TRAVIS_PYTHON_VERSION == 3.* ]]; then
19+
# arm64, ppc64le, s390x CPUs:
20+
# "ERROR: Could not find a version that satisfies the requirement pyqt5"
21+
if [[ $TRAVIS_CPU_ARCH == "amd64" ]]; then
1922
sudo apt-get -qq install pyqt5-dev-tools
2023
pip install pyqt5!=5.14.1
24+
fi
2125
fi
2226

2327
# docs only on Python 3.8

.travis/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ set -e
55
python -m pytest -v -x --cov PIL --cov Tests --cov-report term Tests
66

77
# Docs
8-
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then make doccheck; fi
8+
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ] && [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
9+
make doccheck
10+
fi

Tests/helper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66
import os
7+
import platform
78
import subprocess
89
import sys
910
import tempfile
@@ -348,6 +349,10 @@ def on_ci():
348349
)
349350

350351

352+
def is_big_endian():
353+
return platform.processor() == "s390x"
354+
355+
351356
def is_win32():
352357
return sys.platform.startswith("win32")
353358

Tests/test_file_jpeg2k.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from io import BytesIO
22

3+
import pytest
34
from PIL import Image, Jpeg2KImagePlugin
45

5-
from .helper import PillowTestCase
6+
from .helper import PillowTestCase, is_big_endian, on_ci
67

78
codecs = dir(Image.core)
89

@@ -165,11 +166,13 @@ def test_16bit_monochrome_has_correct_mode(self):
165166
jp2.load()
166167
self.assertEqual(jp2.mode, "I;16")
167168

169+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
168170
def test_16bit_monochrome_jp2_like_tiff(self):
169171
with Image.open("Tests/images/16bit.cropped.tif") as tiff_16bit:
170172
with Image.open("Tests/images/16bit.cropped.jp2") as jp2:
171173
self.assert_image_similar(jp2, tiff_16bit, 1e-3)
172174

175+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
173176
def test_16bit_monochrome_j2k_like_tiff(self):
174177
with Image.open("Tests/images/16bit.cropped.tif") as tiff_16bit:
175178
with Image.open("Tests/images/16bit.cropped.j2k") as j2k:

Tests/test_file_png.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
import zlib
33
from io import BytesIO
44

5+
import pytest
56
from PIL import Image, ImageFile, PngImagePlugin
67

7-
from .helper import PillowLeakTestCase, PillowTestCase, hopper, is_win32
8+
from .helper import (
9+
PillowLeakTestCase,
10+
PillowTestCase,
11+
hopper,
12+
is_big_endian,
13+
is_win32,
14+
on_ci,
15+
)
816

917
try:
1018
from PIL import _webp
@@ -72,6 +80,7 @@ def get_chunks(self, filename):
7280
png.crc(cid, s)
7381
return chunks
7482

83+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
7584
def test_sanity(self):
7685

7786
# internal version number

Tests/test_file_webp_animated.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import pytest
12
from PIL import Image
23

3-
from .helper import PillowTestCase
4+
from .helper import PillowTestCase, is_big_endian, on_ci
45

56
try:
67
from PIL import _webp
@@ -36,6 +37,7 @@ def test_n_frames(self):
3637
self.assertEqual(im.n_frames, 42)
3738
self.assertTrue(im.is_animated)
3839

40+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
3941
def test_write_animation_L(self):
4042
"""
4143
Convert an animated GIF to animated WebP, then compare the
@@ -61,6 +63,7 @@ def test_write_animation_L(self):
6163
im.load()
6264
self.assert_image_similar(im, orig.convert("RGBA"), 25.0)
6365

66+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
6467
def test_write_animation_RGB(self):
6568
"""
6669
Write an animated WebP from RGB frames, and ensure the frames

Tests/test_image_getextrema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import pytest
12
from PIL import Image
23

3-
from .helper import PillowTestCase, hopper
4+
from .helper import PillowTestCase, hopper, is_big_endian, on_ci
45

56

67
class TestImageGetExtrema(PillowTestCase):
8+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
79
def test_extrema(self):
810
def extrema(mode):
911
return hopper(mode).getextrema()
@@ -18,6 +20,7 @@ def extrema(mode):
1820
self.assertEqual(extrema("CMYK"), ((0, 255), (0, 255), (0, 255), (0, 0)))
1921
self.assertEqual(extrema("I;16"), (1, 255))
2022

23+
@pytest.mark.xfail(is_big_endian() and on_ci(), reason="Fails on big-endian")
2124
def test_true_16(self):
2225
with Image.open("Tests/images/16_bit_noise.tif") as im:
2326
self.assertEqual(im.mode, "I;16")

0 commit comments

Comments
 (0)