commit:     153669a03ac148043683e43a145c7be587cf410f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 10:18:16 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 21 10:18:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=153669a0

dev-python/sqlalchemy: Use xdist+rerunfailures

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

 dev-python/sqlalchemy/sqlalchemy-2.0.21.ebuild | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/dev-python/sqlalchemy/sqlalchemy-2.0.21.ebuild 
b/dev-python/sqlalchemy/sqlalchemy-2.0.21.ebuild
index cf09ce847f97..ed6eb3f70f85 100644
--- a/dev-python/sqlalchemy/sqlalchemy-2.0.21.ebuild
+++ b/dev-python/sqlalchemy/sqlalchemy-2.0.21.ebuild
@@ -8,7 +8,7 @@ DISTUTILS_USE_PEP517=setuptools
 PYTHON_COMPAT=( pypy3 python3_{10..12} )
 PYTHON_REQ_USE="sqlite?"
 
-inherit distutils-r1 optfeature pypi
+inherit distutils-r1 multiprocessing optfeature pypi
 
 MY_PN="SQLAlchemy"
 DESCRIPTION="Python SQL toolkit and Object Relational Mapper"
@@ -32,6 +32,8 @@ BDEPEND="
        dev-python/cython[${PYTHON_USEDEP}]
        test? (
                $(python_gen_impl_dep sqlite)
+               dev-python/pytest-rerunfailures[${PYTHON_USEDEP}]
+               dev-python/pytest-xdist[${PYTHON_USEDEP}]
        )
 "
 
@@ -87,14 +89,8 @@ python_test() {
        # means that any DeprecationWarnings from third-party plugins cause
        # everything to explode
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
-       local -x PYTEST_PLUGINS=
-       # upstream automagically depends on xdist when it is importable
-       # note that we can't use xdist because it causes nodes to randomly
-       # crash on init
-       if has_version "dev-python/pytest-xdist[${PYTHON_USEDEP}]"; then
-               PYTEST_PLUGINS+=xdist.plugin
-       fi
-       epytest
+       epytest -p rerunfailures --reruns=10 --reruns-delay=2 \
+               -p xdist -n "$(makeopts_jobs)" --dist=worksteal
 }
 
 python_install_all() {

Reply via email to