Skip to content

Fix forcing color through termcolor #204

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/test_tldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@


@pytest.mark.parametrize("page_name", page_names)
def test_whole_page(page_name):
def test_whole_page(page_name, monkeypatch):
monkeypatch.setenv("FORCE_COLOR", "1")
with open(f"tests/data/{page_name}.md", "rb") as f_original:
with open(f"tests/data/{page_name}_rendered", "rb") as f_rendered:
old_stdout = sys.stdout
Expand Down
2 changes: 2 additions & 0 deletions tldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ def main() -> None:
options = parser.parse_args()

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

if options.update_cache:
update_cache(language=options.language)
Expand Down