summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-11-22 16:56:42 +0100
committerMichał Górny <mgorny@gentoo.org>2023-11-22 16:57:11 +0100
commit1e7680b617adb9a171116d17e0625c39795f2918 (patch)
treefa7f473b3e5b2fe745947e3fe1625687f6f19dda /dev-python
parentdev-python/QtPy: Reenable the test for dev-qt/qtsensors:6 (diff)
downloadgentoo-1e7680b617adb9a171116d17e0625c39795f2918.tar.gz
gentoo-1e7680b617adb9a171116d17e0625c39795f2918.tar.bz2
gentoo-1e7680b617adb9a171116d17e0625c39795f2918.zip
dev-python/QtPy: Refactor/streamline running tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/QtPy/QtPy-2.4.1-r1.ebuild53
1 files changed, 25 insertions, 28 deletions
diff --git a/dev-python/QtPy/QtPy-2.4.1-r1.ebuild b/dev-python/QtPy/QtPy-2.4.1-r1.ebuild
index ca7b19c3936d..ae81a1be637c 100644
--- a/dev-python/QtPy/QtPy-2.4.1-r1.ebuild
+++ b/dev-python/QtPy/QtPy-2.4.1-r1.ebuild
@@ -200,37 +200,34 @@ src_prepare() {
}
python_test() {
+ local -x QT_API
+ local -a EPYTEST_DESELECT
+ local other
+
# Test for each enabled Qt4Python target.
# Deselect the other targets, their test fails if we specify QT_API
# or if we have disabled their corresponding inherit in __init__.py above
- if use pyqt5; then
- einfo "Testing with ${EPYTHON} and QT_API=PyQt5"
- QT_API="pyqt5" virtx epytest \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PySide2] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PyQt6] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PySide6]
- fi
- if use pyqt6; then
- einfo "Testing with ${EPYTHON} and QT_API=PyQt6"
- QT_API="pyqt6" virtx epytest \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PySide2] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PyQt5] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PySide6]
- fi
- if use pyside2; then
- einfo "Testing with ${EPYTHON} and QT_API=PySide2"
- QT_API="pyside2" virtx epytest \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PyQt5] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PyQt6] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PySide6]
- fi
- if use pyside6; then
- einfo "Testing with ${EPYTHON} and QT_API=PySide6"
- QT_API="pyside6" virtx epytest \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PySide2] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PyQt5] \
- --deselect qtpy/tests/test_main.py::test_qt_api_environ[PyQt6]
- fi
+ for QT_API in PyQt{5,6} PySide{2,6}; do
+ if use "${QT_API,,}"; then
+ EPYTEST_DESELECT=()
+ for other in PyQt{5,6} PySide{2,6}; do
+ if [[ ${QT_API} != ${other} ]]; then
+ EPYTEST_DESELECT+=(
+ "qtpy/tests/test_main.py::test_qt_api_environ[${other}]"
+ )
+ fi
+ done
+
+ einfo "Testing with ${EPYTHON} and QT_API=${QT_API}"
+ nonfatal epytest ||
+ die -n "Tests failed with ${EPYTHON} and QT_API=${QT_API}" ||
+ return 1
+ fi
+ done
+}
+
+src_test() {
+ virtx distutils-r1_src_test
}
pkg_postinst() {