Skip to content

Commit

Permalink
python-utils-r1.eclass: Cleanup cache dirs after epytest
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mgorny committed Aug 7, 2021
1 parent 737f8cd commit 71374ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eclass/python-utils-r1.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71374ed

Please sign in to comment.