Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
---
Expand Down
14 changes: 8 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import annotations

import inspect
from collections.abc import Callable
from typing import Any

import httpx
import pytest
Expand All @@ -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:
Expand Down