Coverage for tests / unit / utils / result_formatters / conftest.py: 100%
9 statements
« prev ^ index » next coverage.py v7.13.0, created at 2026-04-03 18:53 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2026-04-03 18:53 +0000
1"""Shared fixtures for result_formatters tests.
3Note: console_capture_with_kwargs is inherited from tests/unit/utils/conftest.py
4"""
6from __future__ import annotations
8from typing import TYPE_CHECKING
10import pytest
12if TYPE_CHECKING:
13 from collections.abc import Callable
16@pytest.fixture
17def success_capture() -> tuple[Callable[[str], None], list[str]]:
18 """Capture success function calls.
20 Returns a tuple containing:
21 - capture function that appends messages
22 - output list containing captured messages
24 Returns:
25 A tuple of (capture_function, output_list).
26 """
27 calls: list[str] = []
29 def capture(message: str = "") -> None:
30 calls.append(message)
32 return capture, calls