From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3492815823F for ; Sat, 18 Nov 2023 16:52:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7901B2BC01F; Sat, 18 Nov 2023 16:52:28 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 227972BC014 for ; Sat, 18 Nov 2023 16:52:28 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/3] python-utils-r1.eclass: Do not pass `-p xdist` w/ PYTEST_PLUGINS Date: Sat, 18 Nov 2023 17:52:16 +0100 Message-ID: <20231118165218.352072-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.42.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: e85e4937-828f-4790-943f-708413ba86c8 X-Archives-Hash: 69531c9f7bca0655de5bb252abf92157 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 --- eclass/python-utils-r1.eclass | 10 +++++++--- 1 file 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 -- 2.42.1