| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,6 @@ | |||
| 5 | 5 | - The complete test suite depends on having at least the following installed | |
| 6 | 6 | (possibly not a complete list) | |
| 7 | 7 | - git (Version 2.24.0 or above is required to run pre-merge-commit tests) | |
| 8 | - - python2 (Required by a test which checks different python versions) | ||
| 9 | 8 | - python3 (Required by a test which checks different python versions) | |
| 10 | 9 | - tox (or virtualenv) | |
| 11 | 10 | - ruby + gem | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,4 +2,5 @@ | |||
| 2 | 2 | name: Python 3 Hook | |
| 3 | 3 | entry: python3-hook | |
| 4 | 4 | language: python | |
| 5 | + language_version: python3 | ||
| 5 | 6 | files: \.py$ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,23 +173,6 @@ def test_python_venv(tempdir_factory, store): | |||
| 173 | 173 | ) | |
| 174 | 174 | ||
| 175 | 175 | ||
| 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[]\nHello World\n') | ||
| 190 | - run_on_version('python3', b'3\n[]\nHello World\n') | ||
| 191 | - | ||
| 192 | - | ||
| 193 | 176 | def test_versioned_python_hook(tempdir_factory, store): | |
| 194 | 177 | _test_hook_repo( | |
| 195 | 178 | tempdir_factory, store, 'python3_hooks_repo', | |
@@ -883,7 +866,7 @@ def test_tags_on_repositories(in_tmpdir, tempdir_factory, store): | |||
| 883 | 866 | @pytest.fixture | |
| 884 | 867 | def local_python_config(): | |
| 885 | 868 | # 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') | ||
| 887 | 870 | manifest = load_manifest(os.path.join(repo_path, C.MANIFEST_FILE)) | |
| 888 | 871 | hooks = [ | |
| 889 | 872 | dict(hook, additional_dependencies=[repo_path]) for hook in manifest | |
@@ -892,23 +875,12 @@ def local_python_config(): | |||
| 892 | 875 | ||
| 893 | 876 | ||
| 894 | 877 | def 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']\nHello 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') | ||
| 907 | 879 | # language_version should have been adjusted to the interpreter version | |
| 908 | 880 | assert hook.language_version != C.DEFAULT | |
| 909 | 881 | ret, out = _hook_run(hook, ('filename',), color=False) | |
| 910 | 882 | assert ret == 0 | |
| 911 | - assert _norm_out(out) == b"2\n['filename']\nHello World\n" | ||
| 883 | + assert _norm_out(out) == b"['filename']\nHello World\n" | ||
| 912 | 884 | ||
| 913 | 885 | ||
| 914 | 886 | def test_default_language_version(store, local_python_config): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments