Skip to content

Implement snapshot testing for CLI output #8

@coderabbitai

Description

@coderabbitai

Background

PR #6 (#6) added create_labels/cli.py, which prints one line per LabelSyncResult in the form "{action}: {name}". The current tests in tests/test_cli.py use literal string assertions that cover only a subset of result types and do not guard against formatting regressions across all three actions (created, updated, unchanged).

Required work

  • Add syrupy (or an equivalent snapshot-testing library) to [dependency-groups].dev in pyproject.toml.
  • Add or extend tests in tests/test_cli.py to snapshot the full captured stdout for each of the three result actions.
  • Commit the initial snapshot files.
  • Document the snapshot update command in docs/developers-guide.md.

Acceptance criteria

  • syrupy (or equivalent) is declared as a dev dependency.
  • Snapshots exist for created, updated, and unchanged CLI output lines.
  • make test passes and snapshots are committed.

Raised by @leynos following review of PR #6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions