mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-22 17:00:28 -06:00
remove docker_is_running check from source
Moved to testing.util so it can be used for the skipif_cant_run_docker test hooks.
This commit is contained in:
committed by
Anthony Sottile
parent
f1de792877
commit
eb8b48aeb4
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user