summaryrefslogtreecommitdiff
path: root/eclass/python-utils-r1.eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2025-06-15 16:37:54 +0200
committerMichał Górny <mgorny@gentoo.org>2025-06-25 06:35:36 +0200
commit1cab1b738232b8ffa9f6834e4af8177cdbc15f27 (patch)
treea59ab1374acdff8aaa5a920b568bf5151f73d7b8 /eclass/python-utils-r1.eclass
parentede484d739a243ad632cf5eee4a8817ebcdb10ff (diff)
downloadgentoo-1cab1b738232b8ffa9f6834e4af8177cdbc15f27.tar.gz
gentoo-1cab1b738232b8ffa9f6834e4af8177cdbc15f27.tar.bz2
gentoo-1cab1b738232b8ffa9f6834e4af8177cdbc15f27.zip
python-utils-r1.eclass: epytest, pass --force-short-summary
Pass `--force-short-summary` when pytest is new enough to accept it, in order to shorten the long (possibly multi-line) exception messages that make the "short summary" hard to read. The complete exception messages are available along with the backtraces anyway. This option is available with >=dev-python/pytest-8.4.0, and it restores the behavior of older dev-python/pytest versions. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass9
1 files changed, 9 insertions, 0 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 840b820d0056..c535a79cb48e 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1347,6 +1347,15 @@ epytest() {
-o tmp_path_retention_policy=failed
)
+ if has_version ">=dev-python/pytest-8.4.0"; then
+ args+=(
+ # do not repeat (potentially multi-line) exception messages
+ # in the "short summary" section to make it more readable;
+ # we have them in the backtraces anyway
+ --force-short-summary
+ )
+ fi
+
if [[ ! ${PYTEST_DISABLE_PLUGIN_AUTOLOAD} ]]; then
args+=(
# disable the undesirable-dependency plugins by default to