From a5e3b8259c87d2176dbaf2c65a6403a3fc2beabc Mon Sep 17 00:00:00 2001 From: Ryan Fox Date: Thu, 26 May 2022 10:24:40 -0700 Subject: [PATCH] dev-python/pyclip: Fix tests Closes: https://bugs.gentoo.org/847169 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Ryan Fox --- dev-python/pyclip/pyclip-0.5.4.ebuild | 20 +++++++++++++++----- dev-python/pyclip/pyclip-0.6.0.ebuild | 12 ++++++++++-- dev-python/pyclip/pyclip-9999.ebuild | 12 ++++++++++-- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/dev-python/pyclip/pyclip-0.5.4.ebuild b/dev-python/pyclip/pyclip-0.5.4.ebuild index ee9f89570d..4bcb1c89a5 100644 --- a/dev-python/pyclip/pyclip-0.5.4.ebuild +++ b/dev-python/pyclip/pyclip-0.5.4.ebuild @@ -1,9 +1,9 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -PYTHON_COMPAT=( python3_{7..11} ) +PYTHON_COMPAT=( python3_{8..11} ) DISTUTILS_USE_SETUPTOOLS=bdepend inherit distutils-r1 @@ -20,9 +20,19 @@ DESCRIPTION="Python clipboard module" HOMEPAGE="https://pypi.org/project/pyclip/" LICENSE="Apache-2.0" SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" -DEPEND="" -RDEPEND="x11-misc/xclip" +DEPEND=" + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" +RDEPEND=" + x11-misc/xclip +" BDEPEND="" -distutils_enable_tests pytest +python_test() { + for unittest in "${S}/tests/"*".py"; do + "${EPYTHON}" "${unittest}" || die "Tests failed" + done +} diff --git a/dev-python/pyclip/pyclip-0.6.0.ebuild b/dev-python/pyclip/pyclip-0.6.0.ebuild index 997c812c2b..409487c500 100644 --- a/dev-python/pyclip/pyclip-0.6.0.ebuild +++ b/dev-python/pyclip/pyclip-0.6.0.ebuild @@ -20,12 +20,20 @@ DESCRIPTION="Python clipboard module" HOMEPAGE="https://pypi.org/project/pyclip/" LICENSE="Apache-2.0" SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" -DEPEND="" +DEPEND=" + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" RDEPEND=" gui-apps/wl-clipboard x11-misc/xclip " BDEPEND="" -distutils_enable_tests pytest +python_test() { + for unittest in "${S}/tests/"*".py"; do + "${EPYTHON}" "${unittest}" || die "Tests failed" + done +} diff --git a/dev-python/pyclip/pyclip-9999.ebuild b/dev-python/pyclip/pyclip-9999.ebuild index 997c812c2b..409487c500 100644 --- a/dev-python/pyclip/pyclip-9999.ebuild +++ b/dev-python/pyclip/pyclip-9999.ebuild @@ -20,12 +20,20 @@ DESCRIPTION="Python clipboard module" HOMEPAGE="https://pypi.org/project/pyclip/" LICENSE="Apache-2.0" SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" -DEPEND="" +DEPEND=" + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" RDEPEND=" gui-apps/wl-clipboard x11-misc/xclip " BDEPEND="" -distutils_enable_tests pytest +python_test() { + for unittest in "${S}/tests/"*".py"; do + "${EPYTHON}" "${unittest}" || die "Tests failed" + done +}