mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-12 09:12:22 +03:00
TST: Parametrize numpy roundtrip to find failing case
Segfaults are annoying to debug.
This commit is contained in:
parent
1c25d95d5a
commit
b9fee08c59
2
.github/workflows/test-cygwin.yml
vendored
2
.github/workflows/test-cygwin.yml
vendored
|
@ -38,6 +38,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
C:\tools\cygwin\bin\python3.8 -m pip install pip wheel setuptools
|
C:\tools\cygwin\bin\python3.8 -m pip install pip wheel setuptools
|
||||||
C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt
|
C:\tools\cygwin\bin\python3.8 -m pip install -r requirements.txt
|
||||||
|
C:\tools\cygwin\bin\python3.8 -m pip install pytest-forked
|
||||||
|
|
||||||
- name: Build Pillow
|
- name: Build Pillow
|
||||||
run: |
|
run: |
|
||||||
|
@ -56,6 +57,7 @@ jobs:
|
||||||
C:\tools\cygwin\bin\mv .ci/test.sh .ci/test.sh.dos
|
C:\tools\cygwin\bin\mv .ci/test.sh .ci/test.sh.dos
|
||||||
C:\tools\cygwin\bin\dash -c "/bin/tr -d '\r' <.ci/test.sh.dos >.ci/test.sh"
|
C:\tools\cygwin\bin\dash -c "/bin/tr -d '\r' <.ci/test.sh.dos >.ci/test.sh"
|
||||||
C:\tools\cygwin\bin\chmod u+x .ci/test.sh
|
C:\tools\cygwin\bin\chmod u+x .ci/test.sh
|
||||||
|
C:\tools\cygwin\bin\python3.8 -m pytest --forked Tests/test_numpy.py -k roundtrip
|
||||||
C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8
|
C:\tools\cygwin\bin\dash /usr/bin/xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh .8
|
||||||
|
|
||||||
- name: After success
|
- name: After success
|
||||||
|
|
|
@ -189,8 +189,9 @@ def test_putdata():
|
||||||
assert len(im.getdata()) == len(arr)
|
assert len(im.getdata()) == len(arr)
|
||||||
|
|
||||||
|
|
||||||
def test_roundtrip_eye():
|
@pytest.mark.parametrize(
|
||||||
for dtype in (
|
"dtype",
|
||||||
|
(
|
||||||
bool,
|
bool,
|
||||||
numpy.bool8,
|
numpy.bool8,
|
||||||
numpy.int8,
|
numpy.int8,
|
||||||
|
@ -202,7 +203,9 @@ def test_roundtrip_eye():
|
||||||
float,
|
float,
|
||||||
numpy.float32,
|
numpy.float32,
|
||||||
numpy.float64,
|
numpy.float64,
|
||||||
):
|
),
|
||||||
|
)
|
||||||
|
def test_roundtrip_eye(dtype):
|
||||||
arr = numpy.eye(10, dtype=dtype)
|
arr = numpy.eye(10, dtype=dtype)
|
||||||
numpy.testing.assert_array_equal(arr, numpy.array(Image.fromarray(arr)))
|
numpy.testing.assert_array_equal(arr, numpy.array(Image.fromarray(arr)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user