We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c43d6d8 commit da131a4Copy full SHA for da131a4
tests/test_commands.py
@@ -72,6 +72,17 @@ def test_commit_retry_works(mocker):
72
assert not os.path.isfile(temp_file)
73
74
75
+def test_commit_when_nothing_to_commit(mocker):
76
+ is_staging_clean_mock = mocker.patch("commitizen.git.is_staging_clean")
77
+ is_staging_clean_mock.return_value = True
78
+
79
+ with pytest.raises(SystemExit) as err:
80
+ commit_cmd = commands.Commit(config, {})
81
+ commit_cmd()
82
83
+ assert err.value.code == commands.commit.NOTHING_TO_COMMIT
84
85
86
def test_example():
87
with mock.patch("commitizen.out.write") as write_mock:
88
commands.Example(config)()
0 commit comments