commit:     5332ccff11d19d17c97b707856b3f1f387acfb8f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 28 20:28:29 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 28 21:50:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5332ccff

dev-python/pytest: Run tests in parallel (again) to save time

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pytest/pytest-6.2.5-r2.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dev-python/pytest/pytest-6.2.5-r2.ebuild 
b/dev-python/pytest/pytest-6.2.5-r2.ebuild
index c3a65979f46f..51a2aecdd80a 100644
--- a/dev-python/pytest/pytest-6.2.5-r2.ebuild
+++ b/dev-python/pytest/pytest-6.2.5-r2.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
 PYTHON_COMPAT=( python3_{8..10} pypy3 )
-inherit distutils-r1
+inherit distutils-r1 multiprocessing
 
 DESCRIPTION="Simple powerful testing with Python"
 HOMEPAGE="https://pytest.org/";
@@ -33,6 +33,7 @@ BDEPEND="
                >=dev-python/hypothesis-3.56[${PYTHON_USEDEP}]
                dev-python/mock[${PYTHON_USEDEP}]
                dev-python/nose[${PYTHON_USEDEP}]
+               dev-python/pytest-xdist[${PYTHON_USEDEP}]
                dev-python/requests[${PYTHON_USEDEP}]
                dev-python/xmlschema[${PYTHON_USEDEP}]
        )"
@@ -47,6 +48,7 @@ src_test() {
 python_test() {
        distutils_install_for_testing --via-root
 
-       "${EPYTHON}" -m pytest -vv --lsof -rfsxX -p no:pkgcore -p no:flaky ||
+       "${EPYTHON}" -m pytest -vv --lsof -rfsxX -p no:pkgcore -p no:flaky \
+               -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" ||
                die "Tests failed with ${EPYTHON}"
 }

Reply via email to