!83 [sync] PR-82: enable test case from setup.py

From: @openeuler-sync-bot
Reviewed-by: @yangzhao_kl
Signed-off-by: @yangzhao_kl
This commit is contained in:
openeuler-ci-bot 2021-08-19 11:15:19 +00:00 committed by Gitee
commit 39b649d729
2 changed files with 54 additions and 1 deletions

View File

@ -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

View File

@ -5,7 +5,7 @@
Name: python-pillow Name: python-pillow
Version: 8.1.2 Version: 8.1.2
Release: 1 Release: 2
Summary: Python image processing library Summary: Python image processing library
License: MIT License: MIT
URL: http://python-pillow.github.io/ URL: http://python-pillow.github.io/
@ -29,9 +29,12 @@ Patch6011: backport-0001-CVE-2021-34552.patch
Patch6012: backport-0002-CVE-2021-34552.patch Patch6012: backport-0002-CVE-2021-34552.patch
Patch6013: backport-Updated-default-value-for-SAMPLESPERPIXEL-tag.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: 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: 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-qt5 python3-setuptools python3-tkinter gcc
BuildRequires: python3-pytest
%if 0%{?with_docs} %if 0%{?with_docs}
BuildRequires: make BuildRequires: make
BuildRequires: python3-sphinx BuildRequires: python3-sphinx
@ -125,6 +128,8 @@ cp -a $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py
pushd build/%py3_libbuilddir pushd build/%py3_libbuilddir
PYTHONPATH=$PWD %{__python3} selftest.py PYTHONPATH=$PWD %{__python3} selftest.py
popd 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 %files -n python3-pillow
%doc README.md CHANGES.rst %doc README.md CHANGES.rst
@ -159,6 +164,9 @@ popd
%{python3_sitearch}/PIL/__pycache__/ImageQt* %{python3_sitearch}/PIL/__pycache__/ImageQt*
%changelog %changelog
* Thu Aug 19 2021 hanhui <hanhui15@huawei.com> - 8.1.2-2
- DESC: enable test case from setup.py
* Wed Jul 14 2021 OpenStack_SIG <openstack@openeuler.org> - 8.1.2-1 * Wed Jul 14 2021 OpenStack_SIG <openstack@openeuler.org> - 8.1.2-1
- Update to 8.1.2 - Update to 8.1.2