File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 4
4
import os
5
5
import sys
6
6
from typing import Any
7
+ from unittest import mock
7
8
8
9
import pytest
9
10
import yaml
@@ -125,6 +126,7 @@ def pre_commit_installed(mocker: MockFixture):
125
126
# Assume the `pre-commit` is installed
126
127
mocker .patch (
127
128
"commitizen.commands.init.ProjectInfo.is_pre_commit_installed" ,
129
+ new_callable = mock .PropertyMock ,
128
130
return_value = True ,
129
131
)
130
132
# And installation success (i.e. no exception raised)
@@ -229,6 +231,7 @@ def test_pre_commit_not_installed(
229
231
# Assume `pre-commit` is not installed
230
232
mocker .patch (
231
233
"commitizen.commands.init.ProjectInfo.is_pre_commit_installed" ,
234
+ new_callable = mock .PropertyMock ,
232
235
return_value = False ,
233
236
)
234
237
with tmpdir .as_cwd ():
@@ -241,6 +244,7 @@ def test_pre_commit_exec_failed(
241
244
# Assume `pre-commit` is installed
242
245
mocker .patch (
243
246
"commitizen.commands.init.ProjectInfo.is_pre_commit_installed" ,
247
+ new_callable = mock .PropertyMock ,
244
248
return_value = True ,
245
249
)
246
250
# But pre-commit installation will fail
You can’t perform that action at this time.
0 commit comments