@@ -480,3 +480,36 @@ def test_changelog_incremental_keep_a_changelog_sample_with_annotated_tag(
480
480
out = f .read ()
481
481
482
482
file_regression .check (out , extension = ".md" )
483
+
484
+
485
+ @pytest .mark .parametrize ("test_input" , ["rc" , "alpha" , "beta" ])
486
+ @pytest .mark .usefixtures ("tmp_commitizen_project" )
487
+ def test_changelog_incremental_with_release_candidate_version (
488
+ mocker , capsys , changelog_path , file_regression , test_input
489
+ ):
490
+ """Fix #357"""
491
+ with open (changelog_path , "w" ) as f :
492
+ f .write (KEEP_A_CHANGELOG )
493
+ create_file_and_commit ("irrelevant commit" )
494
+ git .tag ("1.0.0" , annotated = True )
495
+
496
+ create_file_and_commit ("feat: add new output" )
497
+ create_file_and_commit ("fix: output glitch" )
498
+
499
+ testargs = ["cz" , "bump" , "--changelog" , "--prerelease" , test_input , "--yes" ]
500
+ mocker .patch .object (sys , "argv" , testargs )
501
+ cli .main ()
502
+
503
+ create_file_and_commit ("fix: mama gotta work" )
504
+ create_file_and_commit ("feat: add more stuff" )
505
+ create_file_and_commit ("Merge into master" )
506
+
507
+ testargs = ["cz" , "changelog" , "--incremental" ]
508
+
509
+ mocker .patch .object (sys , "argv" , testargs )
510
+ cli .main ()
511
+
512
+ with open (changelog_path , "r" ) as f :
513
+ out = f .read ()
514
+
515
+ file_regression .check (out , extension = ".md" )
0 commit comments