python-utils-r1.eclass: Cleanup cache dirs after epytest

Make epytest clean up common cache directories .hypothesis
and .pytest_cache after the execution.  If pytest is executed
in ${BUILD_DIR}/lib, these directories end up being wrongly installed,
and so far ebuilds had to handle cleaning them up.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2021-08-07 15:52:49 +02:00
parent 737f8cdb57
commit 71374edfc1
+6 -1
View File
@@ -1272,7 +1272,12 @@ epytest() {
echo "${@}" >&2
"${@}" || die -n "pytest failed with ${EPYTHON}"
return ${?}
local ret=${?}
# remove common temporary directories left over by pytest plugins
rm -rf .hypothesis .pytest_cache || die
return ${ret}
}
# @FUNCTION: eunittest