summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2021-09-11 21:39:17 +0200
committerFlorian Schmaus <flow@gentoo.org>2021-09-14 19:55:45 +0200
commitbe22deb1b7adc56ad559e0184a78d6aa4f614508 (patch)
treeb53bd4a7e9aac9377100d721e567c6fd9f5a68f0 /eclass
parentprofiles: default-enable sys-apps/dbus[user-session] in plasma/systemd profiles (diff)
downloadgentoo-be22deb1b7adc56ad559e0184a78d6aa4f614508.tar.gz
gentoo-be22deb1b7adc56ad559e0184a78d6aa4f614508.tar.bz2
gentoo-be22deb1b7adc56ad559e0184a78d6aa4f614508.zip
python-utils-r1.eclass: add and use _python_check_EPYTHON
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to '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 4fedf939c779..c729651699dd 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1250,6 +1250,16 @@ build_sphinx() {
HTML_DOCS+=( "${dir}/_build/html/." )
}
+# @FUNCTION: _python_check_EPYTHON
+# @INTERNAL
+# @DESCRIPTION:
+# Check if EPYTHON is set, die if not.
+_python_check_EPYTHON() {
+ if [[ -z ${EPYTHON} ]]; then
+ die "EPYTHON unset, invalid call context"
+ fi
+}
+
# @VARIABLE: EPYTEST_DESELECT
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -1279,7 +1289,7 @@ build_sphinx() {
epytest() {
debug-print-function ${FUNCNAME} "${@}"
- [[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
+ _python_check_EPYTHON
local args=(
# verbose progress reporting and tracebacks
@@ -1322,7 +1332,7 @@ epytest() {
eunittest() {
debug-print-function ${FUNCNAME} "${@}"
- [[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
+ _python_check_EPYTHON
set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}"