Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] python-utils-r1.eclass: Include -l in epytest
Date: Fri, 02 Apr 2021 08:45:45
Message-Id: 20210402084535.185492-1-mgorny@gentoo.org
1 Add '-l' to epytest, in order to improve tracebacks by including
2 the values of local variables.
3
4 Signed-off-by: Michał Górny <mgorny@g.o>
5 ---
6 eclass/python-utils-r1.eclass | 11 ++++++++++-
7 1 file changed, 10 insertions(+), 1 deletion(-)
8
9 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
10 index d0bfb7819059..03251a77e40c 100644
11 --- a/eclass/python-utils-r1.eclass
12 +++ b/eclass/python-utils-r1.eclass
13 @@ -1292,7 +1292,16 @@ epytest() {
14 local die_args=()
15 [[ ${EAPI} != [45] ]] && die_args+=( -n )
16
17 - set -- "${EPYTHON}" -m pytest -vv -ra "${@}"
18 + local args=(
19 + # verbose progress reporting and tracebacks
20 + -vv
21 + # list all non-passed tests in the summary for convenience
22 + # (includes failures, skips, xfails...)
23 + -ra
24 + # print local variables in tracebacks, useful for debugging
25 + -l
26 + )
27 + set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}"
28
29 echo "${@}" >&2
30 "${@}" || die "${die_args[@]}" "pytest failed with ${EPYTHON}"
31 --
32 2.31.1