summaryrefslogtreecommitdiffstats
path: root/tests/languages
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 04:23:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 04:23:44 +0000
commit8b9f67e46f462980dd0877e752954a07bfecdb32 (patch)
tree7455f28cae7a78fdec431903475978bbff39f984 /tests/languages
parentAdding upstream version 2.14.0. (diff)
downloadpre-commit-8b9f67e46f462980dd0877e752954a07bfecdb32.tar.xz
pre-commit-8b9f67e46f462980dd0877e752954a07bfecdb32.zip
Adding upstream version 2.15.0.upstream/2.15.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/languages')
-rw-r--r--tests/languages/python_test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/languages/python_test.py b/tests/languages/python_test.py
index 90d1036..8324cac 100644
--- a/tests/languages/python_test.py
+++ b/tests/languages/python_test.py
@@ -9,6 +9,7 @@ from pre_commit.envcontext import envcontext
from pre_commit.languages import python
from pre_commit.prefix import Prefix
from pre_commit.util import make_executable
+from pre_commit.util import win_exe
def test_read_pyvenv_cfg(tmpdir):
@@ -112,7 +113,7 @@ def test_unhealthy_python_goes_missing(python_dir):
python.install_environment(prefix, C.DEFAULT, ())
- exe_name = 'python' if sys.platform != 'win32' else 'python.exe'
+ exe_name = win_exe('python')
py_exe = prefix.path(python.bin_dir('py_env-default'), exe_name)
os.remove(py_exe)
@@ -158,7 +159,7 @@ def test_unhealthy_then_replaced(python_dir):
python.install_environment(prefix, C.DEFAULT, ())
# simulate an exe which returns an old version
- exe_name = 'python.exe' if sys.platform == 'win32' else 'python'
+ exe_name = win_exe('python')
py_exe = prefix.path(python.bin_dir('py_env-default'), exe_name)
os.rename(py_exe, f'{py_exe}.tmp')