Skip to content

Commit b32641a

Browse files
authored
Merge pull request #87 from radarhere/deprecate-qt5
Run deprecated import check before imports from other tests
2 parents f854d7f + 47cf029 commit b32641a

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

.ci/install.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ python3 -m pip install pyroma
3434
python3 -m pip install test-image-results
3535
python3 -m pip install numpy
3636

37-
# PyQt5 doesn't support PyPy3
37+
# PyQt6 doesn't support PyPy3
3838
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
39-
# arm64, ppc64le, s390x CPUs:
40-
# "ERROR: Could not find a version that satisfies the requirement pyqt5"
41-
sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools
42-
python3 -m pip install pyqt5
39+
sudo apt-get -qq install libegl1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxkbcommon-x11-0
40+
python3 -m pip install pyqt6
4341
fi
4442

4543
# webp

Tests/test_deprecated_imageqt.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import warnings
2+
3+
with warnings.catch_warnings(record=True) as w:
4+
# Arrange: cause all warnings to always be triggered
5+
warnings.simplefilter("always")
6+
7+
# Act: trigger a warning with Qt5
8+
from PIL import ImageQt
9+
10+
11+
def test_deprecated():
12+
# Assert
13+
if ImageQt.qt_version in ("5", "side2"):
14+
assert len(w) == 1
15+
assert issubclass(w[0].category, DeprecationWarning)
16+
assert "deprecated" in str(w[0].message)
17+
else:
18+
assert len(w) == 0

Tests/test_imageqt_deprecated.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)