Skip to content

Commit c2893d1

Browse files
committed
test(commands/commit): add test case for raising non customized exception
1 parent 182a58f commit c2893d1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎tests/commands/test_commit_command.py

+11
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,14 @@ def test_commit_when_customized_expected_raised(config, mocker, capsys):
129129

130130
# Assert only the content in the formatted text
131131
assert "This is the root custom err" in str(excinfo.value)
132+
133+
134+
@pytest.mark.usefixtures("staging_is_clean")
135+
def test_commit_when_non_customized_expected_raised(config, mocker, capsys):
136+
_err = ValueError()
137+
prompt_mock = mocker.patch("questionary.prompt")
138+
prompt_mock.side_effect = _err
139+
140+
with pytest.raises(ValueError):
141+
commit_cmd = commands.Commit(config, {})
142+
commit_cmd()

0 commit comments

Comments
 (0)