summaryrefslogtreecommitdiff
path: root/eclass/python-utils-r1.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-21 00:05:36 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-21 00:05:36 +0100
commitbfd63d5b0e96ad32e0d0a8fe15512b6a9ac6fc9e (patch)
tree4d1f8172a8137960573865b4a5ac8b7846d281df /eclass/python-utils-r1.eclass
parent77b275a53383b07b154caa09feb6f4961b206638 (diff)
gentoo auto-resync : 21:05:2024 - 00:05:35
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass14
1 files changed, 12 insertions, 2 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 275ac3a96523..c47565fa1db2 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1321,6 +1321,15 @@ _python_check_occluded_packages() {
# Specifies the number of jobs for parallel (pytest-xdist) test runs.
# When unset, defaults to -j from MAKEOPTS, or the current nproc.
+# @ECLASS_VARIABLE: EPYTEST_FLAGS
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Additional flags to pass to pytest. This is intended to be set
+# in the environment when debugging packages (options such as -x or -s
+# are useful here), rather than globally. It must not be set
+# in ebuilds.
+
# @FUNCTION: epytest
# @USAGE: [<args>...]
# @DESCRIPTION:
@@ -1432,10 +1441,10 @@ epytest() {
for x in "${EPYTEST_IGNORE[@]}"; do
args+=( --ignore "${x}" )
done
- set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}"
+ set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}" ${EPYTEST_FLAGS}
echo "${@}" >&2
- "${@}" || die -n "pytest failed with ${EPYTHON}"
+ "${@}"
local ret=${?}
# remove common temporary directories left over by pytest plugins
@@ -1446,6 +1455,7 @@ epytest() {
find "${BUILD_DIR}" -name '*-pytest-*.pyc' -delete || die
fi
+ [[ ${ret} -ne 0 ]] && die -n "pytest failed with ${EPYTHON}"
return ${ret}
}