commit: 762d0029d5871ece184c02bca13354d159fc35bf
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 25 11:23:02 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 25 11:23:02 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=762d0029
dev-python/hypothesis: Use pytest-xdist to speed tests up
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/hypothesis/hypothesis-5.29.0.ebuild | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/dev-python/hypothesis/hypothesis-5.29.0.ebuild
b/dev-python/hypothesis/hypothesis-5.29.0.ebuild
index c80c7aa009c..89b2b4ea6b8 100644
--- a/dev-python/hypothesis/hypothesis-5.29.0.ebuild
+++ b/dev-python/hypothesis/hypothesis-5.29.0.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_USE_SETUPTOOLS=rdepend
PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
PYTHON_REQ_USE="threads(+),sqlite"
-inherit distutils-r1 eutils
+inherit distutils-r1 eutils multiprocessing
DESCRIPTION="A library for property based testing"
HOMEPAGE="https://github.com/HypothesisWorks/hypothesis
https://pypi.org/project/hypothesis/"
@@ -36,17 +36,11 @@ BDEPEND="
dev-python/mock[${PYTHON_USEDEP}]
dev-python/pexpect[${PYTHON_USEDEP}]
>=dev-python/pytest-5.3.5[${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[${PYTHON_USEDEP}]
!!<dev-python/typing-3.7.4.1
)
"
-src_prepare() {
- # avoid pytest-xdist dep for one test
- sed -i -e 's:test_prints_statistics_given_option_under_xdist:_&:' \
- tests/pytest/test_statistics.py || die
- distutils-r1_src_prepare
-}
-
python_prepare() {
if ! use cli || [[ ${EPYTHON} != python3.[678] ]]; then
sed -i -e '/console_scripts/d' setup.py || die
@@ -54,7 +48,8 @@ python_prepare() {
}
python_test() {
- pytest -vv tests/cover tests/pytest tests/quality ||
+ pytest -vv tests/cover tests/pytest tests/quality \
+ -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" ||
die "Tests fail with ${EPYTHON}"
}