summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-11-18 16:52:00 +0100
committerMichał Górny <mgorny@gentoo.org>2023-11-19 17:01:13 +0100
commita50f2ca09542794bf87e9f3a518d88fecdc0a2fe (patch)
treed65e599d0f6cdbd4cfed0110f7aa581333ba8ef2 /eclass/python-utils-r1.eclass
parentdev-python/requests-cache: Bump to 1.1.1 (diff)
downloadgentoo-a50f2ca09542794bf87e9f3a518d88fecdc0a2fe.tar.gz
gentoo-a50f2ca09542794bf87e9f3a518d88fecdc0a2fe.tar.bz2
gentoo-a50f2ca09542794bf87e9f3a518d88fecdc0a2fe.zip
python-utils-r1.eclass: Do not pass `-p xdist` w/ PYTEST_PLUGINS
Fix `epytest` with `EPYTEST_XDIST` not to pass a duplicate `-p xdist` when `xdist.plugin` is already present in `PYTEST_PLUGINS`. Otherwise, pytest will fail due to the plugin being loaded twice. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass10
1 files changed, 7 insertions, 3 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 80abe974f9df..1de4f325de33 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1390,10 +1390,14 @@ epytest() {
if [[ ${EPYTEST_XDIST} ]]; then
local jobs=${EPYTEST_JOBS:-$(makeopts_jobs)}
if [[ ${jobs} -gt 1 ]]; then
+ if [[ ${PYTEST_PLUGINS} != *xdist.plugin* ]]; then
+ args+=(
+ # explicitly enable the plugin, in case the ebuild was
+ # using PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ -p xdist
+ )
+ fi
args+=(
- # explicitly enable the plugin, in case the ebuild was using
- # PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
- -p xdist
-n "${jobs}"
# worksteal ensures that workers don't end up idle when heavy
# jobs are unevenly distributed