Skip to content

Commit b391bca

Browse files
authored
Fix forcing color through termcolor (#204)
1 parent 373e015 commit b391bca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/test_tldr.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313

1414
@pytest.mark.parametrize("page_name", page_names)
15-
def test_whole_page(page_name):
15+
def test_whole_page(page_name, monkeypatch):
16+
monkeypatch.setenv("FORCE_COLOR", "1")
1617
with open(f"tests/data/{page_name}.md", "rb") as f_original:
1718
with open(f"tests/data/{page_name}_rendered", "rb") as f_rendered:
1819
old_stdout = sys.stdout

tldr.py

+2
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ def main() -> None:
493493
options = parser.parse_args()
494494

495495
colorama.init(strip=options.color)
496+
if options.color is False:
497+
os.environ["FORCE_COLOR"] = "true"
496498

497499
if options.update_cache:
498500
update_cache(language=options.language)

0 commit comments

Comments
 (0)