dev-python/cfu: test handling

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr
This commit is contained in:
Alarig Le Lay 2021-06-18 10:25:55 +02:00
parent 6de4789fb7
commit 9fd71e3319
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC

View file

@ -14,7 +14,24 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="Apache-2.0" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
KEYWORDS="~amd64 ~x86" KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="" DEPEND=""
RDEPEND="${DEPEND}" RDEPEND="${DEPEND}
test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
BDEPEND="" BDEPEND=""
python_test() {
pytest -vv || die "Tests fail with ${EPYTHON}"
}
src_install() {
rm_tests() {
use test || rm -r "${S}-${EPYTHON//\./_}/lib/tests"
}
python_foreach_impl rm_tests
use test || rm -r "${S}/tests"
distutils-r1_src_install
}