summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-11-03 20:04:33 +0100
committerMichał Górny <mgorny@gentoo.org>2023-11-07 06:29:05 +0100
commitfbdeb1cb0ac8c9f4ee68f501485f2a4124bb05bd (patch)
tree49aed0d21ff5def11233d9863794a3bf0c436125 /eclass/distutils-r1.eclass
parentapp-misc/fastfetch: drop 2.2.1 (diff)
downloadgentoo-fbdeb1cb0ac8c9f4ee68f501485f2a4124bb05bd.tar.gz
gentoo-fbdeb1cb0ac8c9f4ee68f501485f2a4124bb05bd.tar.bz2
gentoo-fbdeb1cb0ac8c9f4ee68f501485f2a4124bb05bd.zip
distutils-r1.eclass: Refactor `d_e_t unittest` (NFC)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass17
1 files changed, 8 insertions, 9 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 1cc91110dccf..9dd091921391 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -608,6 +608,8 @@ distutils_enable_tests() {
esac
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
+
+ local test_deps=${RDEPEND}
local test_pkg
case ${1} in
nose)
@@ -619,7 +621,12 @@ distutils_enable_tests() {
setup.py)
;;
unittest)
- # dep handled below
+ # unittest-or-fail is needed in py<3.12
+ test_deps+="
+ $(python_gen_cond_dep '
+ dev-python/unittest-or-fail[${PYTHON_USEDEP}]
+ ' 3.10 3.11)
+ "
;;
*)
die "${FUNCNAME}: unsupported argument: ${1}"
@@ -628,7 +635,6 @@ distutils_enable_tests() {
_DISTUTILS_TEST_RUNNER=${1}
python_test() { distutils-r1_python_test; }
- local test_deps=${RDEPEND}
if [[ -n ${test_pkg} ]]; then
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
@@ -637,13 +643,6 @@ distutils_enable_tests() {
${test_pkg}[\${PYTHON_USEDEP}]
")"
fi
- elif [[ ${1} == unittest ]]; then
- # unittest-or-fail is needed in py<3.12
- test_deps+="
- $(python_gen_cond_dep '
- dev-python/unittest-or-fail[${PYTHON_USEDEP}]
- ' 3.{9..11})
- "
fi
if [[ -n ${test_deps} ]]; then
IUSE+=" test"