@@ -173,23 +173,6 @@ def test_python_venv(tempdir_factory, store):
173173 )
174174
175175
176- @xfailif_windows # pragma: win32 no cover # no python 2 in GHA
177- def test_switch_language_versions_doesnt_clobber (tempdir_factory , store ):
178- # We're using the python3 repo because it prints the python version
179- path = make_repo (tempdir_factory , 'python3_hooks_repo' )
180-
181- def run_on_version (version , expected_output ):
182- config = make_config_from_repo (path )
183- config ['hooks' ][0 ]['language_version' ] = version
184- hook = _get_hook (config , store , 'python3-hook' )
185- ret , out = _hook_run (hook , [], color = False )
186- assert ret == 0
187- assert _norm_out (out ) == expected_output
188-
189- run_on_version ('python2' , b'2\n []\n Hello World\n ' )
190- run_on_version ('python3' , b'3\n []\n Hello World\n ' )
191-
192-
193176def test_versioned_python_hook (tempdir_factory , store ):
194177 _test_hook_repo (
195178 tempdir_factory , store , 'python3_hooks_repo' ,
@@ -883,7 +866,7 @@ def test_tags_on_repositories(in_tmpdir, tempdir_factory, store):
883866@pytest .fixture
884867def local_python_config ():
885868 # Make a "local" hooks repo that just installs our other hooks repo
886- repo_path = get_resource_path ('python3_hooks_repo ' )
869+ repo_path = get_resource_path ('python_hooks_repo ' )
887870 manifest = load_manifest (os .path .join (repo_path , C .MANIFEST_FILE ))
888871 hooks = [
889872 dict (hook , additional_dependencies = [repo_path ]) for hook in manifest
@@ -892,23 +875,12 @@ def local_python_config():
892875
893876
894877def test_local_python_repo (store , local_python_config ):
895- hook = _get_hook (local_python_config , store , 'python3-hook' )
896- # language_version should have been adjusted to the interpreter version
897- assert hook .language_version != C .DEFAULT
898- ret , out = _hook_run (hook , ('filename' ,), color = False )
899- assert ret == 0
900- assert _norm_out (out ) == b"3\n ['filename']\n Hello World\n "
901-
902-
903- @xfailif_windows # pragma: win32 no cover # no python2 in GHA
904- def test_local_python_repo_python2 (store , local_python_config ):
905- local_python_config ['hooks' ][0 ]['language_version' ] = 'python2'
906- hook = _get_hook (local_python_config , store , 'python3-hook' )
878+ hook = _get_hook (local_python_config , store , 'foo' )
907879 # language_version should have been adjusted to the interpreter version
908880 assert hook .language_version != C .DEFAULT
909881 ret , out = _hook_run (hook , ('filename' ,), color = False )
910882 assert ret == 0
911- assert _norm_out (out ) == b"2 \n ['filename']\n Hello World\n "
883+ assert _norm_out (out ) == b"['filename']\n Hello World\n "
912884
913885
914886def test_default_language_version (store , local_python_config ):
0 commit comments