Skip to content
Myr

fix: Skip flaky pager test on macOS with free-threaded Python 3.14t

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

Add a MAC platform constant in `_compat.py` and use it to skip `test_echo_via_pager` on macOS when running free-threaded Python, where generator exception tests are flaky in parallel execution.

authored by Jazzcort · committed by Jazzcort · parent e0d1678 · Browse files · 2 files+6 added−0 removed
This commit

State

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

Diff stats

2 files+6 added−0 removed

  • tests:+5 added−0 removed
  • other:+1 added−0 removed

2 files+6 added−0 removed

modified:src/click/_compat.py+1 added
10 unmodified lines
11from weakref import WeakKeyDictionary1213CYGWIN = sys.platform.startswith("cygwin")14WIN = sys.platform.startswith("win")15MAC = sys.platform == "darwin"16auto_wrap_for_ansi: t.Callable[[t.TextIO], t.TextIO] | None = None17_ansi_re = re.compile(r"\033\[[;?0-9]*[a-zA-Z]")1819
608 unmodified lines
modified:tests/test_utils.py+5 added
13 unmodified lines
14import pytest1516import click._termui_impl17import click.utils18from click._compat import MAC19from click._compat import WIN20from click._utils import UNSET2122
286 unmodified lines
309)310311312@pytest.mark.skipif(WIN, reason="Different behavior on windows.")313@pytest.mark.skipif(314 MAC and sys.version_info >= (3, 13) and sys._is_gil_enabled(),315 reason="Generator exception tests are flaky in Python 3.14t on macOS.",316)317@pytest.mark.parametrize(318 "pager_cmd", ["cat", "cat ", " cat ", "less", " less", " less "]319)320@pytest.mark.parametrize(
467 unmodified lines