1
1
import sys
2
+ from datetime import datetime
2
3
3
4
import pytest
4
5
@@ -78,7 +79,6 @@ def test_changelog_from_start(mocker, capsys, changelog_path, file_regression):
78
79
79
80
80
81
@pytest .mark .usefixtures ("tmp_commitizen_project" )
81
- @pytest .mark .freeze_time ("2022-03-30" )
82
82
def test_changelog_replacing_unreleased_using_incremental (
83
83
mocker , capsys , changelog_path , file_regression
84
84
):
@@ -103,13 +103,14 @@ def test_changelog_replacing_unreleased_using_incremental(
103
103
cli .main ()
104
104
105
105
with open (changelog_path , "r" ) as f :
106
- out = f .read ()
106
+ out = f .read ().replace (
107
+ datetime .strftime (datetime .now (), "%Y-%m-%d" ), "2022-08-14"
108
+ )
107
109
108
110
file_regression .check (out , extension = ".md" )
109
111
110
112
111
113
@pytest .mark .usefixtures ("tmp_commitizen_project" )
112
- @pytest .mark .freeze_time ("2022-03-30" )
113
114
def test_changelog_is_persisted_using_incremental (
114
115
mocker , capsys , changelog_path , file_regression
115
116
):
@@ -139,7 +140,9 @@ def test_changelog_is_persisted_using_incremental(
139
140
cli .main ()
140
141
141
142
with open (changelog_path , "r" ) as f :
142
- out = f .read ()
143
+ out = f .read ().replace (
144
+ datetime .strftime (datetime .now (), "%Y-%m-%d" ), "2022-08-14"
145
+ )
143
146
144
147
file_regression .check (out , extension = ".md" )
145
148
0 commit comments