mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-09 18:47:16 -08:00
python-utils-r1.eclass: epytest, force color output to match NOCOLOR
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 <mgorny@gentoo.org>
This commit is contained in:
@@ -1297,6 +1297,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
|
||||
@@ -1308,6 +1318,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
|
||||
|
||||
Reference in New Issue
Block a user