diff options
author | 2022-11-21 12:14:50 +0000 | |
---|---|---|
committer | 2022-11-21 13:54:09 +0000 | |
commit | f356dcd48faaab0bb78fe085b9d429ff4cdd6d59 (patch) | |
tree | 67165bb24d1fa2c8aa02099e62e3ac5456a614fd /test/default_run.py | |
parent | c396050efabcc0154bc883dcefeb5ab41d998bcd (diff) |
Run test: Disable color output on LUCI
Test: Colors still work locally
Change-Id: I9452de8a6c6274462520f42ce4ddec1449e30696
Diffstat (limited to 'test/default_run.py')
-rwxr-xr-x | test/default_run.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/default_run.py b/test/default_run.py index 3f1baf394b..b5afd8c4a9 100755 --- a/test/default_run.py +++ b/test/default_run.py @@ -21,9 +21,11 @@ from typing import List from subprocess import DEVNULL, PIPE, STDOUT from tempfile import NamedTemporaryFile -COLOR_RED = '\033[91m' -COLOR_BLUE = '\033[94m' -COLOR_NORMAL = '\033[0m' +COLOR = (os.environ.get("LUCI_CONTEXT") == None) # Disable colors on LUCI. +COLOR_BLUE = '\033[94m' if COLOR else '' +COLOR_GREEN = '\033[92m' if COLOR else '' +COLOR_NORMAL = '\033[0m' if COLOR else '' +COLOR_RED = '\033[91m' if COLOR else '' def parse_args(argv): argp, opt_bool = ArgumentParser(), BooleanOptionalAction |