From 2f15c92ea390c0ce305a0f7568c00b4b5a5dc945 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Thu, 22 Sep 2022 13:02:40 -0400 Subject: [PATCH] When running in GitHub Actions, force colors on Fixes #243 --- ward/_terminal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ward/_terminal.py b/ward/_terminal.py index 858206fa..184813ea 100644 --- a/ward/_terminal.py +++ b/ward/_terminal.py @@ -93,7 +93,10 @@ "usedby": "#9285F6", } ) -rich_console = Console(theme=theme, highlighter=NullHighlighter()) +in_ci_supporting_color = os.environ.get("GITHUB_ACTIONS") == "true" +rich_console = Console( + theme=theme, highlighter=NullHighlighter(), force_terminal=in_ci_supporting_color +) def format_test_id(test_result: TestResult) -> str: