mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-21 10:37:22 -08:00
python-utils-r1.eclass: use std test runner in eunittest in 3.12+
Starting with Python 3.12, the standard unittest runner exits unsucessfully if no tests are found. Therefore, we no longer need to use unittest_or_fail. Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1344,7 +1344,12 @@ eunittest() {
|
||||
|
||||
_python_check_EPYTHON
|
||||
|
||||
set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}"
|
||||
# unittest fails with "no tests" correctly since Python 3.12
|
||||
local runner=unittest
|
||||
if _python_impl_matches "${EPYTHON}" 3.{9..11}; then
|
||||
runner=unittest_or_fail
|
||||
fi
|
||||
set -- "${EPYTHON}" -m "${runner}" discover -v "${@}"
|
||||
|
||||
echo "${@}" >&2
|
||||
"${@}" || die -n "Tests failed with ${EPYTHON}"
|
||||
|
||||
Reference in New Issue
Block a user