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 DDE2715823F for ; Sat, 18 Nov 2023 16:52:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65E3E2BC033; Sat, 18 Nov 2023 16:52:29 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 18D872BC030 for ; Sat, 18 Nov 2023 16:52:29 +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 2/3] python-utils-r1.eclass: Do not pass `-p no:*` w/ no autoloading Date: Sat, 18 Nov 2023 17:52:17 +0100 Message-ID: <20231118165218.352072-2-mgorny@gentoo.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231118165218.352072-1-mgorny@gentoo.org> References: <20231118165218.352072-1-mgorny@gentoo.org> 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: 85113343-b1cf-47ec-a22b-355737aeffe6 X-Archives-Hash: 308dc18af5404d867bf85e9581949ee8 Modify `epytest` not to pass our plethora of `-p no:*` arguments when `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set. This is NFC since the plugins wouldn't be loaded anyway. Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 51 +++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 1de4f325de33..394f64a5d139 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1362,31 +1362,36 @@ epytest() { # count is more precise when we're dealing with a large number # of tests -o console_output_style=count - # disable the undesirable-dependency plugins by default to - # trigger missing argument strips. strip options that require - # them from config files. enable them explicitly via "-p ..." - # if you *really* need them. - -p no:cov - -p no:flake8 - -p no:flakes - -p no:pylint - # sterilize pytest-markdown as it runs code snippets from all - # *.md files found without any warning - -p no:markdown - # pytest-sugar undoes everything that's good about pytest output - # and makes it hard to read logs - -p no:sugar - # pytest-xvfb automatically spawns Xvfb for every test suite, - # effectively forcing it even when we'd prefer the tests - # not to have DISPLAY at all, causing crashes sometimes - # and causing us to miss missing virtualx usage - -p no:xvfb - # intrusive packages that break random test suites - -p no:pytest-describe - -p no:plus - -p no:tavern ) + if [[ ! ${PYTEST_DISABLE_PLUGIN_AUTOLOAD} ]]; then + args+=( + # disable the undesirable-dependency plugins by default to + # trigger missing argument strips. strip options that require + # them from config files. enable them explicitly via "-p ..." + # if you *really* need them. + -p no:cov + -p no:flake8 + -p no:flakes + -p no:pylint + # sterilize pytest-markdown as it runs code snippets from all + # *.md files found without any warning + -p no:markdown + # pytest-sugar undoes everything that's good about pytest output + # and makes it hard to read logs + -p no:sugar + # pytest-xvfb automatically spawns Xvfb for every test suite, + # effectively forcing it even when we'd prefer the tests + # not to have DISPLAY at all, causing crashes sometimes + # and causing us to miss missing virtualx usage + -p no:xvfb + # intrusive packages that break random test suites + -p no:pytest-describe + -p no:plus + -p no:tavern + ) + fi + if [[ ${EPYTEST_XDIST} ]]; then local jobs=${EPYTEST_JOBS:-$(makeopts_jobs)} if [[ ${jobs} -gt 1 ]]; then -- 2.42.1