summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-07-10 19:55:32 +0200
committerMichał Górny <mgorny@gentoo.org>2021-08-07 15:52:49 +0200
commit71374edfc174ffbd6ae8b6b80ad65629697d5fbd (patch)
tree878600a21343145fec5deb205762a54282d29006 /eclass/python-utils-r1.eclass
parentdev-python/aiorpcX: enable py3.10 (diff)
downloadgentoo-71374edfc174ffbd6ae8b6b80ad65629697d5fbd.tar.gz
gentoo-71374edfc174ffbd6ae8b6b80ad65629697d5fbd.tar.bz2
gentoo-71374edfc174ffbd6ae8b6b80ad65629697d5fbd.zip
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>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass7
1 files changed, 6 insertions, 1 deletions
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