Skip to content

Commit 5b1624b

Browse files
authored
fix color handling in test runner (#2729)
2 parents d3e3852 + d83868a commit 5b1624b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Unreleased
1010
multiple lines. :issue:`2697`
1111
- Fixed issue that prevented a default value of ``""`` from being displayed in
1212
the help for an option. :issue:`2500`
13+
- The test runner handles stripping color consistently on Windows.
14+
:issue:`2705`
1315

1416

1517
Version 8.1.7

src/click/testing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import typing as t
99
from types import TracebackType
1010

11+
from . import _compat
1112
from . import formatting
1213
from . import termui
1314
from . import utils
@@ -315,6 +316,7 @@ def should_strip_ansi(
315316
termui.hidden_prompt_func = hidden_input
316317
termui._getchar = _getchar
317318
utils.should_strip_ansi = should_strip_ansi # type: ignore
319+
_compat.should_strip_ansi = should_strip_ansi
318320

319321
old_env = {}
320322
try:

tests/test_testing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import pytest
66

77
import click
8-
from click._compat import WIN
98
from click.testing import CliRunner
109

1110

@@ -184,7 +183,6 @@ def cli():
184183
assert result.exit_code == 1
185184

186185

187-
@pytest.mark.skipif(WIN, reason="Test does not make sense on Windows.")
188186
def test_with_color():
189187
@click.command()
190188
def cli():

0 commit comments

Comments
 (0)