diff --git a/backport-disable-test-sanity.patch b/backport-disable-test-sanity.patch new file mode 100644 index 0000000000000000000000000000000000000000..2d6ff722795122141892f3a055b2d003f5de075b --- /dev/null +++ b/backport-disable-test-sanity.patch @@ -0,0 +1,45 @@ +From dd3eb37c615243a0c71d61639578d1bf4618f806 Mon Sep 17 00:00:00 2001 +Date: Thu, 5 Aug 2021 14:51:41 +0800 +Subject: [PATCH] disable test_sanity + +--- + Tests/test_qt_image_qapplication.py | 26 -------------------------- + 1 file changed, 26 deletions(-) + +diff --git a/Tests/test_qt_image_qapplication.py b/Tests/test_qt_image_qapplication.py +index 06bd27c..8d4bb58 100644 +--- a/Tests/test_qt_image_qapplication.py ++++ b/Tests/test_qt_image_qapplication.py +@@ -35,29 +35,3 @@ def roundtrip(expected): + result = ImageQt.fromqpixmap(ImageQt.toqpixmap(expected)) + # Qt saves all pixmaps as rgb + assert_image_equal(result, expected.convert("RGB")) +- +- +-@pytest.mark.skipif(not ImageQt.qt_is_installed, reason="Qt bindings are not installed") +-def test_sanity(tmp_path): +- # Segfault test +- app = QApplication([]) +- ex = Example() +- assert app # Silence warning +- assert ex # Silence warning +- +- for mode in ("1", "RGB", "RGBA", "L", "P"): +- # to QPixmap +- data = ImageQt.toqpixmap(hopper(mode)) +- +- assert isinstance(data, QPixmap) +- assert not data.isNull() +- +- # Test saving the file +- tempfile = str(tmp_path / f"temp_{mode}.png") +- data.save(tempfile) +- +- # from QPixmap +- roundtrip(hopper(mode)) +- +- app.quit() +- app = None +-- +2.27.0 + diff --git a/python-pillow.spec b/python-pillow.spec index 4a38e40b579815fa08ad2d28f5bdcfeb2addcf15..fda606b4e3dee5083f913a4a38b93a5f2b9332a4 100644 --- a/python-pillow.spec +++ b/python-pillow.spec @@ -5,7 +5,7 @@ Name: python-pillow Version: 8.1.2 -Release: 1 +Release: 2 Summary: Python image processing library License: MIT URL: http://python-pillow.github.io/ @@ -29,9 +29,12 @@ Patch6011: backport-0001-CVE-2021-34552.patch Patch6012: backport-0002-CVE-2021-34552.patch Patch6013: backport-Updated-default-value-for-SAMPLESPERPIXEL-tag.patch +Patch9000: backport-disable-test-sanity.patch + BuildRequires: freetype-devel ghostscript lcms2-devel libimagequant-devel libjpeg-devel libraqm-devel libtiff-devel BuildRequires: libwebp-devel openjpeg2-devel tk-devel zlib-devel python3-cffi python3-devel python3-numpy python3-olefile BuildRequires: python3-qt5 python3-setuptools python3-tkinter gcc +BuildRequires: python3-pytest %if 0%{?with_docs} BuildRequires: make BuildRequires: python3-sphinx @@ -125,6 +128,8 @@ cp -a $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py pushd build/%py3_libbuilddir PYTHONPATH=$PWD %{__python3} selftest.py popd +export PYTHONPATH=%{buildroot}%{python3_sitearch} +pytest --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v -k 'not (test_stroke or test_stroke_multiline)' %files -n python3-pillow %doc README.md CHANGES.rst @@ -159,6 +164,9 @@ popd %{python3_sitearch}/PIL/__pycache__/ImageQt* %changelog +* Thu Aug 19 2021 hanhui - 8.1.2-2 +- DESC: enable test case from setup.py + * Wed Jul 14 2021 OpenStack_SIG - 8.1.2-1 - Update to 8.1.2