mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 06:23:34 +08:00
integration tests: add --force-color & set in CI
github actions supports color output, but does not report as a tty. See https://github.com/actions/runner/issues/241.
This commit is contained in:
@@ -4,6 +4,7 @@ import os
|
||||
from enum import Enum
|
||||
from functools import lru_cache
|
||||
|
||||
force_color = False
|
||||
|
||||
class color(Enum):
|
||||
PURPLE = '\033[95m'
|
||||
@@ -20,7 +21,7 @@ class color(Enum):
|
||||
|
||||
|
||||
def colorize(text: str, c: color) -> str:
|
||||
if _supports_color():
|
||||
if force_color or _supports_color():
|
||||
return str(c.value) + text + color.RESET.value
|
||||
else:
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user