Skip to content

Commit

Permalink
Fix snapshot being modified by pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
pederhan committed Nov 19, 2024
1 parent 2adb80f commit 305483d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/commands/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ def other_command(ctx: typer.Context) -> None: # type: ignore
cmd.invoke(new_ctx)
captured = capsys.readouterr()
assert captured.err == snapshot("")
assert captured.out == snapshot(
"""\

Usage: other-command help-command [OPTIONS]
Help for the other command.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
"""
)
# We cannot test the output with snapshot testing, because
# the trim-trailing-whitespace pre-commit hook modifies the
# snapshot output. Not ideal, so we have to test the relevant lines instead.
assert "Usage: other-command help-command [OPTIONS]" in captured.out
assert "Help for the other command." in captured.out
assert "Options" in captured.out
assert "--help" in captured.out
assert "Show this message and exit." in captured.out

0 comments on commit 305483d

Please sign in to comment.