From 71374edfc174ffbd6ae8b6b80ad65629697d5fbd Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sat, 10 Jul 2021 19:55:32 +0200 Subject: python-utils-r1.eclass: Cleanup cache dirs after epytest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- eclass/python-utils-r1.eclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'eclass') diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 168c767a2eea..b104b6694ac3 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -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 -- cgit v1.2.3-65-gdbad