@@ -130,16 +130,15 @@ def test_commit_command_with_write_message_to_file_option(
130
130
commit_mock .return_value = cmd .Command ("success" , "" , b"" , b"" , 0 )
131
131
success_mock = mocker .patch ("commitizen.out.success" )
132
132
133
- commands .Commit (config , {"write_message_to_file" : str ( tmp_file ) })()
133
+ commands .Commit (config , {"write_message_to_file" : tmp_file })()
134
134
success_mock .assert_called_once ()
135
135
assert tmp_file .exists ()
136
136
assert tmp_file .read_text () == "feat: user created"
137
137
138
138
139
139
@pytest .mark .usefixtures ("staging_is_clean" )
140
- @pytest .mark .parametrize ("message_file" , [True , False , 0 , 1 ])
141
140
def test_commit_command_with_invalid_write_message_to_file_option (
142
- config , message_file , mocker : MockFixture
141
+ config , tmp_path , mocker : MockFixture
143
142
):
144
143
prompt_mock = mocker .patch ("questionary.prompt" )
145
144
prompt_mock .return_value = {
@@ -152,8 +151,7 @@ def test_commit_command_with_invalid_write_message_to_file_option(
152
151
}
153
152
154
153
with pytest .raises (NotAllowed ):
155
- print (isinstance (message_file , str ))
156
- commit_cmd = commands .Commit (config , {"write_message_to_file" : message_file })
154
+ commit_cmd = commands .Commit (config , {"write_message_to_file" : tmp_path })
157
155
commit_cmd ()
158
156
159
157
0 commit comments