diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c791c3..03a43af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,8 +18,8 @@ # so pyproject.toml dev-deps are the SINGLE version authority — no rev # pin to drift against. # -# CI runs this same hook set via the dryvist `_python-ci.yml` reusable workflow -# (see .github/workflows/ci.yml). zizmor is NOT here: it runs CENTRALLY via +# CI runs this same hook set directly: the `gate` job in +# .github/workflows/ci.yml. zizmor is NOT here: it runs CENTRALLY via # `_zizmor.yml` against dryvist/.github's canonical zizmor.yml (zero-copy — # this repo no longer carries a zizmor.yml). --- diff --git a/tests/conftest.py b/tests/conftest.py index efde0c1..c6feb0b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,8 @@ from __future__ import annotations +import inspect from collections.abc import Callable +from typing import Any import httpx import pytest @@ -16,13 +18,13 @@ def cli_runner() -> CliRunner: Click below 8.2 folds stderr into stdout unless asked not to, so reading ``result.stderr`` raises. Click 8.2 removed the parameter and always - separates. Ask for separation, and fall back when the parameter is gone. - Only tests that assert on stderr need this. + separates. Ask for separation only when the installed Click still takes + the parameter. Only tests that assert on stderr need this. """ - try: - return CliRunner(mix_stderr=False) # type: ignore[call-arg] - except TypeError: - return CliRunner() + kwargs: dict[str, Any] = {} + if "mix_stderr" in inspect.signature(CliRunner.__init__).parameters: + kwargs["mix_stderr"] = False + return CliRunner(**kwargs) def make_client(handler: Callable, *, dry_run: bool = False) -> SplunkClient: