summaryrefslogtreecommitdiff
path: root/eclass/distutils-r1.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-07 10:17:51 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-07 10:17:51 +0000
commite0fac29676c44b996e61c06f8d5c92288e46966b (patch)
treebe619e692a42f1a90900cca21b19a2ec88404f8d /eclass/distutils-r1.eclass
parent639971d0c3ee4eef36854ab7d9729b6e8c3ac1cb (diff)
gentoo auto-resync : 07:11:2023 - 10:17:51
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass32
1 files changed, 17 insertions, 15 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 1cc91110dccf..3d756eaad556 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -608,18 +608,28 @@ distutils_enable_tests() {
esac
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
- local test_pkg
+
+ local test_deps=${RDEPEND}
+ local test_pkgs
case ${1} in
nose)
- test_pkg=">=dev-python/nose-1.3.7_p20221026"
+ test_pkgs='>=dev-python/nose-1.3.7_p20221026[${PYTHON_USEDEP}]'
;;
pytest)
- test_pkg=">=dev-python/pytest-7.3.1"
+ test_pkgs='>=dev-python/pytest-7.3.1[${PYTHON_USEDEP}]'
+ if [[ ${EPYTEST_XDIST} ]]; then
+ test_pkgs+=' dev-python/pytest-xdist[${PYTHON_USEDEP}]'
+ fi
;;
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,22 +638,14 @@ distutils_enable_tests() {
_DISTUTILS_TEST_RUNNER=${1}
python_test() { distutils-r1_python_test; }
- local test_deps=${RDEPEND}
- if [[ -n ${test_pkg} ]]; then
+ if [[ -n ${test_pkgs} ]]; then
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
+ test_deps+=" ${test_pkgs//'${PYTHON_USEDEP}'/${PYTHON_USEDEP}}"
else
test_deps+=" $(python_gen_cond_dep "
- ${test_pkg}[\${PYTHON_USEDEP}]
+ ${test_pkgs}
")"
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"