commit:     be50ed0537e06560614cedc379c60292300a7e3e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 14 12:48:38 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May 20 16:56:44 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be50ed05

python-utils-r1.eclass: Support passing EPYTEST_FLAGS

Closes: https://bugs.gentoo.org/905863
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/python-utils-r1.eclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 275ac3a96523..584ed831f816 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,7 +1441,7 @@ 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}"

Reply via email to