From df8f9663ac22f45f4bfe7cf82f481b80ff23f66f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 2 Apr 2021 10:43:42 +0200 Subject: [PATCH] python-utils-r1.eclass: Include -l in epytest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add '-l' to epytest, in order to improve tracebacks by including the values of local variables. Signed-off-by: Michał Górny --- 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 d0bfb78190597..03251a77e40c5 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1292,7 +1292,16 @@ epytest() { local die_args=() [[ ${EAPI} != [45] ]] && die_args+=( -n ) - set -- "${EPYTHON}" -m pytest -vv -ra "${@}" + local args=( + # verbose progress reporting and tracebacks + -vv + # list all non-passed tests in the summary for convenience + # (includes failures, skips, xfails...) + -ra + # print local variables in tracebacks, useful for debugging + -l + ) + set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}" echo "${@}" >&2 "${@}" || die "${die_args[@]}" "pytest failed with ${EPYTHON}"