On 12/11/23 2:30 PM, Ulrich Mueller wrote: >>>>>> On Mon, 11 Dec 2023, Eli Schwartz wrote: > >>> + local color=yes >>> + [[ ${NO_COLOR} ]] && color=no > >> [[ -v NO_COLOR ]] > > No, this would give the wrong result if NO_COLOR is set to an empty > value. [[ ${NO_COLOR} ]] or [[ -n ${NO_COLOR} ]] is the correct test: > > "Command-line software which adds ANSI color to its output by default > should check for a NO_COLOR environment variable that, when present > and not an empty string (regardless of its value), prevents the > addition of ANSI color." -- https://no-color.org/
Again, not according to pytest itself. ;) Given the commit message says: """ Adjust it to correctly check whether it is set at all rather than to a specific value, to match the behavior of pytest itself. """ -- Eli Schwartz