summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-03-25 19:44:50 +0100
committerMichał Górny <mgorny@gentoo.org>2024-04-01 11:36:32 +0200
commit380a5cbd2745ddfea53724246bf3b98976982064 (patch)
tree3c857edd7d860a22a6e5c18cdea25d4976d19437 /eclass
parentdistutils-r1.eclass: Remove nosetests support (diff)
downloadgentoo-380a5cbd2745ddfea53724246bf3b98976982064.tar.gz
gentoo-380a5cbd2745ddfea53724246bf3b98976982064.tar.bz2
gentoo-380a5cbd2745ddfea53724246bf3b98976982064.zip
distutils-r1.eclass: Refactor `distutils_enable_tests pytest`
Refactor `distutils_enable_tests pytest` to move `test_pkgs` logic straight into pytest block, as it is not used by any other variant anymore. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/distutils-r1.eclass20
1 files changed, 9 insertions, 11 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 44553f8da6f3..a1617999a037 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -606,16 +606,23 @@ distutils_enable_tests() {
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
local test_deps=${RDEPEND}
- local test_pkgs
case ${1} in
pytest)
- test_pkgs='>=dev-python/pytest-7.4.4[${PYTHON_USEDEP}]'
+ local test_pkgs='>=dev-python/pytest-7.4.4[${PYTHON_USEDEP}]'
if [[ -n ${EPYTEST_TIMEOUT} ]]; then
test_pkgs+=' dev-python/pytest-timeout[${PYTHON_USEDEP}]'
fi
if [[ ${EPYTEST_XDIST} ]]; then
test_pkgs+=' dev-python/pytest-xdist[${PYTHON_USEDEP}]'
fi
+
+ if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
+ test_deps+=" ${test_pkgs//'${PYTHON_USEDEP}'/${PYTHON_USEDEP}}"
+ else
+ test_deps+=" $(python_gen_cond_dep "
+ ${test_pkgs}
+ ")"
+ fi
;;
setup.py)
;;
@@ -634,15 +641,6 @@ distutils_enable_tests() {
_DISTUTILS_TEST_RUNNER=${1}
python_test() { distutils-r1_python_test; }
- if [[ -n ${test_pkgs} ]]; then
- if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- test_deps+=" ${test_pkgs//'${PYTHON_USEDEP}'/${PYTHON_USEDEP}}"
- else
- test_deps+=" $(python_gen_cond_dep "
- ${test_pkgs}
- ")"
- fi
- fi
if [[ -n ${test_deps} ]]; then
IUSE+=" test"
RESTRICT+=" !test? ( test )"