diff --git a/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass b/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass index e213273a3a..b08dbd586b 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass +++ b/sdk_container/src/third_party/portage-stable/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