File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 44import os
55import sys
66from typing import Any
7+ from unittest import mock
78
89import pytest
910import yaml
@@ -125,6 +126,7 @@ def pre_commit_installed(mocker: MockFixture):
125126 # Assume the `pre-commit` is installed
126127 mocker .patch (
127128 "commitizen.commands.init.ProjectInfo.is_pre_commit_installed" ,
129+ new_callable = mock .PropertyMock ,
128130 return_value = True ,
129131 )
130132 # And installation success (i.e. no exception raised)
@@ -229,6 +231,7 @@ def test_pre_commit_not_installed(
229231 # Assume `pre-commit` is not installed
230232 mocker .patch (
231233 "commitizen.commands.init.ProjectInfo.is_pre_commit_installed" ,
234+ new_callable = mock .PropertyMock ,
232235 return_value = False ,
233236 )
234237 with tmpdir .as_cwd ():
@@ -241,6 +244,7 @@ def test_pre_commit_exec_failed(
241244 # Assume `pre-commit` is installed
242245 mocker .patch (
243246 "commitizen.commands.init.ProjectInfo.is_pre_commit_installed" ,
247+ new_callable = mock .PropertyMock ,
244248 return_value = True ,
245249 )
246250 # But pre-commit installation will fail
You can’t perform that action at this time.
0 commit comments