1
0
Fork 0

Merging upstream version 2.7.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:21:56 +01:00
parent 5aec43d541
commit 57d38a2ac5
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
24 changed files with 323 additions and 99 deletions

View file

@ -5,14 +5,24 @@ import subprocess
import pytest
from pre_commit import parse_shebang
from pre_commit.languages.docker import docker_is_running
from pre_commit.util import CalledProcessError
from pre_commit.util import cmd_output
from pre_commit.util import cmd_output_b
from testing.auto_namedtuple import auto_namedtuple
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
def docker_is_running() -> bool: # pragma: win32 no cover
try:
cmd_output_b('docker', 'ps')
except CalledProcessError: # pragma: no cover
return False
else:
return True
def get_resource_path(path):
return os.path.join(TESTING_DIR, 'resources', path)