@@ -131,9 +131,9 @@ def test_python_hook(tempdir_factory, store):
131131def test_python_hook_default_version (tempdir_factory , store ):
132132 # make sure that this continues to work for platforms where default
133133 # language detection does not work
134- with mock .patch . object (
135- python , ' get_default_version' , return_value = C . DEFAULT ,
136- ):
134+ returns_default = mock .Mock ( return_value = C . DEFAULT )
135+ lang = languages [ ' python' ]. _replace ( get_default_version = returns_default )
136+ with mock . patch . dict ( languages , python = lang ):
137137 test_python_hook (tempdir_factory , store )
138138
139139
@@ -243,6 +243,15 @@ def test_run_a_node_hook(tempdir_factory, store):
243243 )
244244
245245
246+ def test_run_a_node_hook_default_version (tempdir_factory , store ):
247+ # make sure that this continues to work for platforms where node is not
248+ # installed at the system
249+ returns_default = mock .Mock (return_value = C .DEFAULT )
250+ lang = languages ['node' ]._replace (get_default_version = returns_default )
251+ with mock .patch .dict (languages , node = lang ):
252+ test_run_a_node_hook (tempdir_factory , store )
253+
254+
246255def test_run_versioned_node_hook (tempdir_factory , store ):
247256 _test_hook_repo (
248257 tempdir_factory , store , 'node_versioned_hooks_repo' ,
0 commit comments