File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 8
8
config = {"name" : defaults .name }
9
9
10
10
11
+ @pytest .fixture
12
+ def staging_is_clean (mocker ):
13
+ is_staging_clean_mock = mocker .patch ("commitizen.git.is_staging_clean" )
14
+ is_staging_clean_mock .return_value = False
15
+
16
+
17
+ @pytest .mark .usefixtures ("staging_is_clean" )
11
18
def test_commit (mocker ):
12
19
prompt_mock = mocker .patch ("questionary.prompt" )
13
20
prompt_mock .return_value = {
@@ -27,6 +34,7 @@ def test_commit(mocker):
27
34
success_mock .assert_called_once ()
28
35
29
36
37
+ @pytest .mark .usefixtures ("staging_is_clean" )
30
38
def test_commit_retry_fails_no_backup (mocker ):
31
39
commit_mock = mocker .patch ("commitizen.git.commit" )
32
40
commit_mock .return_value = cmd .Command ("success" , "" , "" , "" )
@@ -35,6 +43,7 @@ def test_commit_retry_fails_no_backup(mocker):
35
43
commands .Commit (config , {"retry" : True })()
36
44
37
45
46
+ @pytest .mark .usefixtures ("staging_is_clean" )
38
47
def test_commit_retry_works (mocker ):
39
48
prompt_mock = mocker .patch ("questionary.prompt" )
40
49
prompt_mock .return_value = {
You can’t perform that action at this time.
0 commit comments