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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7855E158086 for ; Sat, 11 Dec 2021 07:35:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A9B92BC01A; Sat, 11 Dec 2021 07:35:03 +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 3B9DC2BC001 for ; Sat, 11 Dec 2021 07:35:02 +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] python-utils-r1.eclass: epytest, force color output to match NOCOLOR Date: Sat, 11 Dec 2021 08:34:53 +0100 Message-Id: <20211211073453.435738-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.34.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: 38b99dbe-de7d-41da-988f-ed15fb2592b5 X-Archives-Hash: 5981f057467019c954d211fe6f72de80 Force pytest color output on or off based on the presence and value of NOCOLOR envvar. This fixes inconsistent use of colors that largely depended on upstream pytest settings. Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 22e00c56815d..225f781cc31f 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1291,6 +1291,16 @@ epytest() { _python_check_EPYTHON + local color + case ${NOCOLOR} in + true|yes) + color=no + ;; + *) + color=yes + ;; + esac + local args=( # verbose progress reporting and tracebacks -vv @@ -1302,6 +1312,8 @@ epytest() { # override filterwarnings=error, we do not really want -Werror # for end users, as it tends to fail on new warnings from deps -Wdefault + # override color output + "--color=${color}" ) local x for x in "${EPYTEST_DESELECT[@]}"; do -- 2.34.1