Skip to content

Commit

Permalink
test: Cover run() in dry-run mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgate committed Jun 10, 2024
1 parent 27bc6d6 commit c44d6ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_staged_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ def test_run_override_print_commands(
assert f"Executing: {command}" in captured.out


def test_run_dry_run(
script: StagedScript, capsys: pytest.CaptureFixture
) -> None:
"""Test the :func:`run` method in dry-run mode."""
command = "echo 'dry-run mode'"
script.dry_run = True
script.run(command)
captured = capsys.readouterr()
for _ in ["The command executed would be", command]:
assert _ in captured.out


@pytest.mark.parametrize("script_success", [True, False])
@pytest.mark.parametrize(
"extras",
Expand Down

0 comments on commit c44d6ff

Please sign in to comment.