Support using the "gentoo" hypothesis profile, as installed by dev-python/hypothesis-gentoo, to disable all Hypothesis health checks. This avoids spurious test failures, e.g. when the system is under load and the strategies are underperforming.
Signed-off-by: Michał Górny <[email protected]> --- eclass/python-utils-r1.eclass | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index dce565b8b036..9e94acf34edf 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1518,6 +1518,17 @@ epytest() { fi fi + # If we are using hypothesis (require use via EPYTEST_PLUGINS, since + # ebuilds may disable autoloading manually) *and* hypothesis-gentoo + # is available, use it to disable all health checks, to prevent the tests + # from failing randomly under load. + if has hypothesis "${EPYTEST_PLUGINS[@]}" && + "${EPYTHON}" -c 'import hypothesis_gentoo' 2>/dev/null && + [[ ! ${HYPOTHESIS_NO_PLUGINS} ]] + then + args+=( --hypothesis-profile=gentoo ) + fi + local x for x in "${EPYTEST_DESELECT[@]}"; do args+=( --deselect "${x}" )
