Skip to content

Commit ffd43e9

Browse files
Tyl13davidism
authored andcommitted
Fixed missing reset on _compat.should_strip_ansi.
1 parent 9ce8bd8 commit ffd43e9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Unreleased
2727
:issue:`2452`
2828
- Refactor code generating default ``--help`` option to deduplicate code.
2929
:pr:`2563`
30+
- Test ``CLIRunner`` resets patched ``_compat.should_strip_ansi``.
31+
:issue:`2732`
3032

3133

3234
Version 8.1.7

src/click/testing.py

+2
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def should_strip_ansi(
312312
old_hidden_prompt_func = termui.hidden_prompt_func
313313
old__getchar_func = termui._getchar
314314
old_should_strip_ansi = utils.should_strip_ansi # type: ignore
315+
old__compat_should_strip_ansi = _compat.should_strip_ansi
315316
termui.visible_prompt_func = visible_input
316317
termui.hidden_prompt_func = hidden_input
317318
termui._getchar = _getchar
@@ -346,6 +347,7 @@ def should_strip_ansi(
346347
termui.hidden_prompt_func = old_hidden_prompt_func
347348
termui._getchar = old__getchar_func
348349
utils.should_strip_ansi = old_should_strip_ansi # type: ignore
350+
_compat.should_strip_ansi = old__compat_should_strip_ansi
349351
formatting.FORCED_WIDTH = old_forced_width
350352

351353
def invoke(

0 commit comments

Comments
 (0)