summaryrefslogtreecommitdiff
path: root/eclass/python-utils-r1.eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2025-10-14 08:54:55 +0200
committerMichał Górny <mgorny@gentoo.org>2025-10-23 20:19:12 +0200
commitddda228a67a145f1baed788b5a605dc382ddc9a9 (patch)
tree71749c9495b149c789be0cd40ee5b13194aebae8 /eclass/python-utils-r1.eclass
parentcfa5bab4ebb1904240057c970d52291c1594eac2 (diff)
downloadgentoo-ddda228a67a145f1baed788b5a605dc382ddc9a9.tar.gz
gentoo-ddda228a67a145f1baed788b5a605dc382ddc9a9.tar.bz2
gentoo-ddda228a67a145f1baed788b5a605dc382ddc9a9.zip
python-utils-r1.eclass: Use --force-reruns for EPYTEST_RERUNS
Use "--force-reruns" rather than "--reruns" when available. This ensures that the rerun count is respected for all tests, including tests already marked upstream for reruns. Otherwise tests marked "@pytest.mark.flaky" will get rerun only once. Signed-off-by: Michał Górny <mgorny@gentoo.org> Part-of: https://github.com/gentoo/gentoo/pull/44172 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass14
1 files changed, 11 insertions, 3 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index e213273a3a78..b08dbd586ba8 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1538,9 +1538,17 @@ epytest() {
)
fi
- args+=(
- "--reruns=${EPYTEST_RERUNS}"
- )
+ if has_version ">=dev-python/pytest-rerunfailures-16.1"; then
+ args+=(
+ # --reruns only adds N reruns for tests not marked for reruns
+ # --force-reruns overrides the rerun count for all tests
+ "--force-reruns=${EPYTEST_RERUNS}"
+ )
+ else
+ args+=(
+ "--reruns=${EPYTEST_RERUNS}"
+ )
+ fi
fi
if [[ -n ${EPYTEST_TIMEOUT} ]]; then