Skip to content

Commit 26a7d32

Browse files
committed
test(commands/changelog): enhance test_changelog_uses_version_tags_for_header check
1 parent 191215d commit 26a7d32

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/commands/test_changelog_command.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
from datetime import datetime
44

55
import pytest
6-
from pytest_mock import MockFixture
7-
from dateutil import relativedelta
8-
96
from commitizen import cli, git
107
from commitizen.commands.changelog import Changelog
118
from commitizen.exceptions import (
@@ -15,6 +12,8 @@
1512
NotAGitProjectError,
1613
NotAllowed,
1714
)
15+
from dateutil import relativedelta
16+
from pytest_mock import MockFixture
1817
from tests.utils import (
1918
create_branch,
2019
create_file_and_commit,
@@ -1291,7 +1290,11 @@ def test_changelog_uses_version_tags_for_header(mocker: MockFixture, config):
12911290
with pytest.raises(DryRunExit):
12921291
changelog()
12931292

1294-
assert write_patch.call_args[0][0].startswith("## 1.0.0")
1293+
changelog_output = write_patch.call_args[0][0]
1294+
1295+
assert changelog_output.startswith("## 1.0.0")
1296+
assert "0-no-a-version" not in changelog_output
1297+
assert "also-not-a-version" not in changelog_output
12951298

12961299

12971300
@pytest.mark.usefixtures("tmp_commitizen_project")

0 commit comments

Comments
 (0)