diff --git a/CHANGES.rst b/CHANGES.rst index f298cee77..8a09daf35 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,8 @@ Unreleased multiple lines. :issue:`2697` - Fixed issue that prevented a default value of ``""`` from being displayed in the help for an option. :issue:`2500` +- The test runner handles stripping color consistently on Windows. + :issue:`2705` Version 8.1.7 diff --git a/src/click/testing.py b/src/click/testing.py index 7a3bec6c6..b517fd09f 100644 --- a/src/click/testing.py +++ b/src/click/testing.py @@ -8,6 +8,7 @@ import typing as t from types import TracebackType +from . import _compat from . import formatting from . import termui from . import utils @@ -315,6 +316,7 @@ def should_strip_ansi( termui.hidden_prompt_func = hidden_input termui._getchar = _getchar utils.should_strip_ansi = should_strip_ansi # type: ignore + _compat.should_strip_ansi = should_strip_ansi old_env = {} try: diff --git a/tests/test_testing.py b/tests/test_testing.py index 4733221be..73010f624 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -5,7 +5,6 @@ import pytest import click -from click._compat import WIN from click.testing import CliRunner @@ -184,7 +183,6 @@ def cli(): assert result.exit_code == 1 -@pytest.mark.skipif(WIN, reason="Test does not make sense on Windows.") def test_with_color(): @click.command() def cli():