public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR
@ 2023-12-02 12:44 Michał Górny
  2023-12-11 18:57 ` Eli Schwartz
  0 siblings, 1 reply; 8+ messages in thread
From: Michał Górny @ 2023-12-02 12:44 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Michał Górny

Update epytest to respect the modern NO_COLOR variable rather than
Portage's old NOCOLOR.  Adjust it to correctly check whether it is set
at all rather than to a specific value, to match the behavior of pytest
itself.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 394f64a5d139..da9cb820840f 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1336,15 +1336,8 @@ epytest() {
 	_python_check_EPYTHON
 	_python_check_occluded_packages
 
-	local color
-	case ${NOCOLOR} in
-		true|yes)
-			color=no
-			;;
-		*)
-			color=yes
-			;;
-	esac
+	local color=yes
+	[[ ${NO_COLOR} ]] && color=no
 
 	local args=(
 		# verbose progress reporting and tracebacks
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-11 21:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-02 12:44 [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR Michał Górny
2023-12-11 18:57 ` Eli Schwartz
2023-12-11 19:27   ` Michał Górny
2023-12-11 20:22     ` Eli Schwartz
2023-12-11 19:30   ` Ulrich Mueller
2023-12-11 20:21     ` Eli Schwartz
2023-12-11 20:38       ` Ulrich Mueller
2023-12-11 21:11         ` Toralf Förster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox