summaryrefslogtreecommitdiffstats
path: root/testing/language_helpers.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-03 06:00:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-03 06:00:57 +0000
commitdbe5fee0cda6758f97aab92d7f31bca27503ca27 (patch)
treec337673d93ed3e18c3025a39300bccab4f454c0a /testing/language_helpers.py
parentReleasing debian version 3.0.2-1. (diff)
downloadpre-commit-dbe5fee0cda6758f97aab92d7f31bca27503ca27.tar.xz
pre-commit-dbe5fee0cda6758f97aab92d7f31bca27503ca27.zip
Merging upstream version 3.0.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/language_helpers.py')
-rw-r--r--testing/language_helpers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/testing/language_helpers.py b/testing/language_helpers.py
index f9ae0b1..b9c5384 100644
--- a/testing/language_helpers.py
+++ b/testing/language_helpers.py
@@ -3,7 +3,6 @@ from __future__ import annotations
import os
from typing import Sequence
-import pre_commit.constants as C
from pre_commit.languages.all import Language
from pre_commit.prefix import Prefix
@@ -14,13 +13,16 @@ def run_language(
exe: str,
args: Sequence[str] = (),
file_args: Sequence[str] = (),
- version: str = C.DEFAULT,
+ version: str | None = None,
deps: Sequence[str] = (),
is_local: bool = False,
) -> tuple[int, bytes]:
prefix = Prefix(str(path))
+ version = version or language.get_default_version()
language.install_environment(prefix, version, deps)
+ health_error = language.health_check(prefix, version)
+ assert health_error is None, health_error
with language.in_env(prefix, version):
ret, out = language.run_hook(
prefix,