Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d563504

Browse files
committed
fix(get-next-bump): add a test case
1 parent 9971a32 commit d563504

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎tests/commands/test_bump_command.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,24 @@ def test_bump_get_next(mocker: MockFixture, capsys):
14801480
tag_exists = git.tag_exist("0.2.0")
14811481
assert tag_exists is False
14821482

1483+
@pytest.mark.usefixtures("tmp_commitizen_project")
1484+
def test_bump_get_next_update_changelog_on_bump(mocker: MockFixture, capsys, config_path):
1485+
create_file_and_commit("feat: new file")
1486+
with open(config_path, "a", encoding="utf-8") as fp:
1487+
fp.write("update_changelog_on_bump = true\n")
1488+
1489+
testargs = ["cz", "bump", "--yes", "--get-next"]
1490+
mocker.patch.object(sys, "argv", testargs)
1491+
with pytest.raises(GetNextExit):
1492+
cli.main()
1493+
1494+
out, _ = capsys.readouterr()
1495+
assert "0.2.0" in out
1496+
1497+
tag_exists = git.tag_exist("0.2.0")
1498+
assert tag_exists is False
1499+
1500+
14831501

14841502
@pytest.mark.usefixtures("tmp_commitizen_project")
14851503
def test_bump_get_next__changelog_is_not_allowed(mocker: MockFixture):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /