summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-08-25 13:23:02 +0200
committerMichał Górny <mgorny@gentoo.org>2020-08-25 13:23:02 +0200
commit762d0029d5871ece184c02bca13354d159fc35bf (patch)
tree3cb2ab6c0accc28af34b096f0a0393b14fb00f83
parentdev-python/xmlschema: Loosen elementpath dep (diff)
downloadgentoo-762d0029.tar.gz
gentoo-762d0029.tar.bz2
gentoo-762d0029.zip
dev-python/hypothesis: Use pytest-xdist to speed tests up
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/hypothesis/hypothesis-5.29.0.ebuild13
1 files 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 c80c7aa009cf..89b2b4ea6b8b 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}"
}