Skip to content
Myr

test runner handles color on windows

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by trl75 · committed by David Lord · parent d3e3852 · Browse files · 3 files+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−2 removed

  • tests:+0 added−2 removed
  • other:+4 added−0 removed

3 files+4 added−2 removed

modified:src/click/testing.py+2 added
6 unmodified lines
7import tempfile8import typing as t9from types import TracebackType1011from . import _compat12from . import formatting13from . import termui14from . import utils15from ._compat import _find_binary_reader
299 unmodified lines
315 termui.visible_prompt_func = visible_input316 termui.hidden_prompt_func = hidden_input317 termui._getchar = _getchar318 utils.should_strip_ansi = should_strip_ansi # type: ignore319 _compat.should_strip_ansi = should_strip_ansi320321 old_env = {}322 try:323 for key, value in env.items():
158 unmodified lines
modified:tests/test_testing.py-2 removed
3 unmodified lines
45import pytest67import click8from click._compat import WIN8from click.testing import CliRunner91011def test_runner():
170 unmodified lines
182 result = runner.invoke(cli)183 assert result.exit_code == 1184185187@pytest.mark.skipif(WIN, reason="Test does not make sense on Windows.")186def test_with_color():187 @click.command()188 def cli():189 click.secho("hello world", fg="blue")
229 unmodified lines
modified:CHANGES.rst+2 added
8 unmodified lines
9- Fix issue where error message for invalid ``click.Path`` displays on10 multiple lines. :issue:`2697`11- Fixed issue that prevented a default value of ``""`` from being displayed in12 the help for an option. :issue:`2500`13- The test runner handles stripping color consistently on Windows.14 :issue:`2705`151617Version 8.1.718-------------
1102 unmodified lines