Code cleanup and tests

This commit is contained in:
Ben Picolo 2017-01-04 10:35:00 -05:00
parent 5f392f0ba5
commit 9b92f96ed0
7 changed files with 92 additions and 21 deletions

View file

@ -0,0 +1,3 @@
FROM cogniteev/echo
CMD ["echo", "This is overwritten by the hooks.yaml 'entry'"]

View file

@ -0,0 +1,11 @@
- id: docker-hook
name: Docker test hook
entry: echo
language: docker
files: \.txt$
- id: docker-hook-failing
name: Docker test hook with nonzero exit code
entry: bork
language: docker
files: \.txt$

View file

@ -6,6 +6,7 @@ import shutil
import jsonschema
import pytest
from pre_commit.languages.docker import docker_is_running
from pre_commit.util import cmd_output
from pre_commit.util import cwd
@ -57,6 +58,11 @@ def cmd_output_mocked_pre_commit_home(*args, **kwargs):
return cmd_output(*args, env=env, **kwargs)
skipif_cant_run_docker = pytest.mark.skipif(
docker_is_running() is False,
reason='Docker isn\'t running or can\'t be accessed'
)
skipif_slowtests_false = pytest.mark.skipif(
os.environ.get('slowtests') == 'false',
reason='slowtests=false',