From ddda228a67a145f1baed788b5a605dc382ddc9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 14 Oct 2025 08:54:55 +0200 Subject: python-utils-r1.eclass: Use --force-reruns for EPYTEST_RERUNS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: https://github.com/gentoo/gentoo/pull/44172 Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'eclass/python-utils-r1.eclass') 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 -- cgit v1.2.3