Skip to content

Commit 44bd2f5

Browse files
authored
Merge pull request #3721 from masatake/units-py--NO_COLOR
units.py: don't use color if NO_COLOR is specified
2 parents e1abef6 + 157925f commit 44bd2f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

misc/units.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,8 @@ def action_run(parser, action, *args):
900900
help='run a test case with specified timeout in seconds. 0 means no timeout (default).')
901901
parser.add_argument('--with-valgrind', action='store_true', default=False,
902902
help='run a test case under valgrind')
903-
parser.add_argument('--colorized-output', choices=['yes', 'no'], default='yes',
903+
parser.add_argument('--colorized-output', choices=['yes', 'no'],
904+
default='yes' if len(os.environ.get('NO_COLOR', "")) == 0 else 'no',
904905
help='print the result in color.')
905906
parser.add_argument('--run-shrink', action='store_true', default=False,
906907
help='(TODO: NOT IMPLEMENTED YET)')

0 commit comments

Comments
 (0)