Coverage for tests / unit / cli_utils / command_chainer / conftest.py: 90%
20 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 CommandChainer tests."""
3from __future__ import annotations
5import click
6import pytest
9@pytest.fixture
10def mock_group() -> click.Group:
11 """Create a mock Click group with test commands.
13 Returns:
14 click.Group: A Click group with fmt, chk, and tst commands.
15 """
17 @click.group()
18 def cli() -> None:
19 """Test CLI group."""
20 pass
22 @cli.command(name="fmt")
23 @click.argument("paths", nargs=-1)
24 def fmt_cmd(paths: tuple[str, ...]) -> int:
25 """Format command.
27 Args:
28 paths: Paths to format.
30 Returns:
31 int: Exit code (always 0).
32 """
33 return 0
35 @cli.command(name="chk")
36 @click.argument("paths", nargs=-1)
37 def chk_cmd(paths: tuple[str, ...]) -> int:
38 """Check command.
40 Args:
41 paths: Paths to check.
43 Returns:
44 int: Exit code (always 0).
45 """
46 return 0
48 @cli.command(name="tst")
49 def tst_cmd() -> int:
50 """Test command.
52 Returns:
53 int: Exit code (always 0).
54 """
55 return 0
57 return cli