Implement pre-commit init-templatedir

This commit is contained in:
Anthony Sottile 2019-07-20 19:10:50 -07:00
parent 3def940574
commit 9a52eefc99
7 changed files with 114 additions and 9 deletions

View file

@ -11,6 +11,7 @@ import pytest
import six
from pre_commit import output
from pre_commit.envcontext import envcontext
from pre_commit.logging_handler import logging_handler
from pre_commit.store import Store
from pre_commit.util import cmd_output
@ -272,3 +273,10 @@ def fake_log_handler():
logger.addHandler(handler)
yield handler
logger.removeHandler(handler)
@pytest.fixture(scope='session', autouse=True)
def set_git_templatedir(tmpdir_factory):
tdir = str(tmpdir_factory.mktemp('git_template_dir'))
with envcontext([('GIT_TEMPLATE_DIR', tdir)]):
yield