Skip to content

Commit 376427c

Browse files
committed
test: add exclamation mark test
Closes #682
1 parent 9211505 commit 376427c

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

tests/commands/test_changelog_command.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,21 @@ def test_breaking_change_content_v1_with_exclamation_mark(
530530
file_regression.check(out, extension=".md")
531531

532532

533+
@pytest.mark.usefixtures("tmp_commitizen_project")
534+
def test_breaking_change_content_v1_with_exclamation_mark_feat(
535+
mocker: MockFixture, capsys, file_regression
536+
):
537+
commit_message = "feat(pipeline)!: some text with breaking change"
538+
create_file_and_commit(commit_message)
539+
testargs = ["cz", "changelog", "--dry-run"]
540+
mocker.patch.object(sys, "argv", testargs)
541+
with pytest.raises(DryRunExit):
542+
cli.main()
543+
out, _ = capsys.readouterr()
544+
545+
file_regression.check(out, extension=".md")
546+
547+
533548
@pytest.mark.usefixtures("tmp_commitizen_project")
534549
def test_changelog_config_flag_increment(
535550
mocker: MockFixture, changelog_path, config_path, file_regression
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Unreleased
2+
3+
### Feat
4+
5+
- **pipeline**: some text with breaking change
6+

tests/test_bump_find_increment.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
"fix(setup.py): future is now required for every python version",
4949
]
5050

51+
MAJOR_INCREMENTS_EXCLAMATION_CC_SAMPLE_2 = [
52+
"feat(pipeline)!: some text with breaking change"
53+
]
54+
5155
MAJOR_INCREMENTS_EXCLAMATION_OTHER_TYPE_CC = [
5256
"chore!: drop support for Python 3.9",
5357
"docs(README): motivation",
@@ -82,6 +86,7 @@
8286
(MAJOR_INCREMENTS_BREAKING_CHANGE_ALT_CC, "MAJOR"),
8387
(MAJOR_INCREMENTS_EXCLAMATION_OTHER_TYPE_CC, "MAJOR"),
8488
(MAJOR_INCREMENTS_EXCLAMATION_CC, "MAJOR"),
89+
(MAJOR_INCREMENTS_EXCLAMATION_CC_SAMPLE_2, "MAJOR"),
8590
(NONE_INCREMENT_CC, None),
8691
),
8792
)

0 commit comments

Comments
 (0)