mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
git grep -l tmpdir_factory | xargs sed -i 's/tmpdir_factory/tempdir_factory/g'
This commit is contained in:
parent
5791d84236
commit
1dfcf10036
14 changed files with 199 additions and 199 deletions
|
|
@ -25,8 +25,8 @@ from testing.util import get_resource_path
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def up_to_date_repo(tmpdir_factory):
|
||||
yield make_repo(tmpdir_factory, 'python_hooks_repo')
|
||||
def up_to_date_repo(tempdir_factory):
|
||||
yield make_repo(tempdir_factory, 'python_hooks_repo')
|
||||
|
||||
|
||||
def test_up_to_date_repo(up_to_date_repo, runner_with_mocked_store):
|
||||
|
|
@ -53,8 +53,8 @@ def test_autoupdate_up_to_date_repo(
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def out_of_date_repo(tmpdir_factory):
|
||||
path = make_repo(tmpdir_factory, 'python_hooks_repo')
|
||||
def out_of_date_repo(tempdir_factory):
|
||||
path = make_repo(tempdir_factory, 'python_hooks_repo')
|
||||
original_sha = get_head_sha(path)
|
||||
|
||||
# Make a commit
|
||||
|
|
@ -97,8 +97,8 @@ def test_autoupdate_out_of_date_repo(
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def hook_disappearing_repo(tmpdir_factory):
|
||||
path = make_repo(tmpdir_factory, 'python_hooks_repo')
|
||||
def hook_disappearing_repo(tempdir_factory):
|
||||
path = make_repo(tempdir_factory, 'python_hooks_repo')
|
||||
original_sha = get_head_sha(path)
|
||||
|
||||
with cwd(path):
|
||||
|
|
@ -143,8 +143,8 @@ def test_autoupdate_hook_disappearing_repo(
|
|||
assert before == after
|
||||
|
||||
|
||||
def test_autoupdate_local_hooks(tmpdir_factory):
|
||||
git_path = git_dir(tmpdir_factory)
|
||||
def test_autoupdate_local_hooks(tempdir_factory):
|
||||
git_path = git_dir(tempdir_factory)
|
||||
config = config_with_local_hooks()
|
||||
path = add_config_to_repo(git_path, config)
|
||||
runner = Runner(path)
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ def test_is_previous_pre_commit(in_tmpdir):
|
|||
assert is_previous_pre_commit('foo')
|
||||
|
||||
|
||||
def test_install_pre_commit(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
def test_install_pre_commit(tempdir_factory):
|
||||
path = git_dir(tempdir_factory)
|
||||
runner = Runner(path)
|
||||
ret = install(runner)
|
||||
assert ret == 0
|
||||
|
|
@ -80,8 +80,8 @@ def test_install_pre_commit(tmpdir_factory):
|
|||
assert pre_push_contents == expected_contents
|
||||
|
||||
|
||||
def test_install_hooks_directory_not_present(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
def test_install_hooks_directory_not_present(tempdir_factory):
|
||||
path = git_dir(tempdir_factory)
|
||||
# Simulate some git clients which don't make .git/hooks #234
|
||||
shutil.rmtree(os.path.join(path, '.git', 'hooks'))
|
||||
runner = Runner(path)
|
||||
|
|
@ -90,23 +90,23 @@ def test_install_hooks_directory_not_present(tmpdir_factory):
|
|||
|
||||
|
||||
@xfailif_no_symlink
|
||||
def test_install_hooks_dead_symlink(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
def test_install_hooks_dead_symlink(tempdir_factory):
|
||||
path = git_dir(tempdir_factory)
|
||||
os.symlink('/fake/baz', os.path.join(path, '.git', 'hooks', 'pre-commit'))
|
||||
runner = Runner(path)
|
||||
install(runner)
|
||||
assert os.path.exists(runner.pre_commit_path)
|
||||
|
||||
|
||||
def test_uninstall_does_not_blow_up_when_not_there(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
def test_uninstall_does_not_blow_up_when_not_there(tempdir_factory):
|
||||
path = git_dir(tempdir_factory)
|
||||
runner = Runner(path)
|
||||
ret = uninstall(runner)
|
||||
assert ret == 0
|
||||
|
||||
|
||||
def test_uninstall(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
def test_uninstall(tempdir_factory):
|
||||
path = git_dir(tempdir_factory)
|
||||
runner = Runner(path)
|
||||
assert not os.path.exists(runner.pre_commit_path)
|
||||
install(runner)
|
||||
|
|
@ -116,7 +116,7 @@ def test_uninstall(tmpdir_factory):
|
|||
|
||||
|
||||
def _get_commit_output(
|
||||
tmpdir_factory,
|
||||
tempdir_factory,
|
||||
touch_file='foo',
|
||||
home=None,
|
||||
env_base=os.environ,
|
||||
|
|
@ -124,7 +124,7 @@ def _get_commit_output(
|
|||
cmd_output('touch', touch_file)
|
||||
cmd_output('git', 'add', touch_file)
|
||||
# Don't want to write to home directory
|
||||
home = home or tmpdir_factory.get()
|
||||
home = home or tempdir_factory.get()
|
||||
env = dict(env_base, PRE_COMMIT_HOME=home)
|
||||
return cmd_output(
|
||||
'git', 'commit', '-m', 'Commit!', '--allow-empty',
|
||||
|
|
@ -154,36 +154,36 @@ NORMAL_PRE_COMMIT_RUN = re.compile(
|
|||
)
|
||||
|
||||
|
||||
def test_install_pre_commit_and_run(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_install_pre_commit_and_run(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
assert install(Runner(path)) == 0
|
||||
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def test_install_idempotent(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_install_idempotent(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
assert install(Runner(path)) == 0
|
||||
assert install(Runner(path)) == 0
|
||||
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def test_environment_not_sourced(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_environment_not_sourced(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
# Patch the executable to simulate rming virtualenv
|
||||
with mock.patch.object(sys, 'executable', '/bin/false'):
|
||||
assert install(Runner(path)) == 0
|
||||
|
||||
# Use a specific homedir to ignore --user installs
|
||||
homedir = tmpdir_factory.get()
|
||||
homedir = tempdir_factory.get()
|
||||
# Need this so we can call git commit without sploding
|
||||
with io.open(os.path.join(homedir, '.gitconfig'), 'w') as gitconfig:
|
||||
gitconfig.write(
|
||||
|
|
@ -215,12 +215,12 @@ FAILING_PRE_COMMIT_RUN = re.compile(
|
|||
)
|
||||
|
||||
|
||||
def test_failing_hooks_returns_nonzero(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'failing_hook_repo')
|
||||
def test_failing_hooks_returns_nonzero(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'failing_hook_repo')
|
||||
with cwd(path):
|
||||
assert install(Runner(path)) == 0
|
||||
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 1
|
||||
assert FAILING_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
|
@ -233,8 +233,8 @@ EXISTING_COMMIT_RUN = re.compile(
|
|||
)
|
||||
|
||||
|
||||
def test_install_existing_hooks_no_overwrite(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_install_existing_hooks_no_overwrite(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ def test_install_existing_hooks_no_overwrite(tmpdir_factory):
|
|||
make_executable(runner.pre_commit_path)
|
||||
|
||||
# Make sure we installed the "old" hook correctly
|
||||
ret, output = _get_commit_output(tmpdir_factory, touch_file='baz')
|
||||
ret, output = _get_commit_output(tempdir_factory, touch_file='baz')
|
||||
assert ret == 0
|
||||
assert EXISTING_COMMIT_RUN.match(output)
|
||||
|
||||
|
|
@ -252,14 +252,14 @@ def test_install_existing_hooks_no_overwrite(tmpdir_factory):
|
|||
assert install(runner) == 0
|
||||
|
||||
# We should run both the legacy and pre-commit hooks
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert output.startswith('legacy hook\n')
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output[len('legacy hook\n'):])
|
||||
|
||||
|
||||
def test_install_existing_hook_no_overwrite_idempotent(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_install_existing_hook_no_overwrite_idempotent(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ def test_install_existing_hook_no_overwrite_idempotent(tmpdir_factory):
|
|||
assert install(runner) == 0
|
||||
|
||||
# We should run both the legacy and pre-commit hooks
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert output.startswith('legacy hook\n')
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output[len('legacy hook\n'):])
|
||||
|
|
@ -286,8 +286,8 @@ FAIL_OLD_HOOK = re.compile(
|
|||
)
|
||||
|
||||
|
||||
def test_failing_existing_hook_returns_1(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_failing_existing_hook_returns_1(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
|
||||
|
|
@ -299,23 +299,23 @@ def test_failing_existing_hook_returns_1(tmpdir_factory):
|
|||
assert install(runner) == 0
|
||||
|
||||
# We should get a failure from the legacy hook
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 1
|
||||
assert FAIL_OLD_HOOK.match(output)
|
||||
|
||||
|
||||
def test_install_overwrite_no_existing_hooks(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_install_overwrite_no_existing_hooks(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
assert install(Runner(path), overwrite=True) == 0
|
||||
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def test_install_overwrite(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_install_overwrite(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
|
||||
|
|
@ -326,13 +326,13 @@ def test_install_overwrite(tmpdir_factory):
|
|||
|
||||
assert install(runner, overwrite=True) == 0
|
||||
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def test_uninstall_restores_legacy_hooks(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_uninstall_restores_legacy_hooks(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
|
||||
|
|
@ -346,13 +346,13 @@ def test_uninstall_restores_legacy_hooks(tmpdir_factory):
|
|||
assert uninstall(runner) == 0
|
||||
|
||||
# Make sure we installed the "old" hook correctly
|
||||
ret, output = _get_commit_output(tmpdir_factory, touch_file='baz')
|
||||
ret, output = _get_commit_output(tempdir_factory, touch_file='baz')
|
||||
assert ret == 0
|
||||
assert EXISTING_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def test_replace_old_commit_script(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_replace_old_commit_script(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
|
||||
|
|
@ -371,13 +371,13 @@ def test_replace_old_commit_script(tmpdir_factory):
|
|||
# Install normally
|
||||
assert install(runner) == 0
|
||||
|
||||
ret, output = _get_commit_output(tmpdir_factory)
|
||||
ret, output = _get_commit_output(tempdir_factory)
|
||||
assert ret == 0
|
||||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def test_uninstall_doesnt_remove_not_our_hooks(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
def test_uninstall_doesnt_remove_not_our_hooks(tempdir_factory):
|
||||
path = git_dir(tempdir_factory)
|
||||
with cwd(path):
|
||||
runner = Runner(path)
|
||||
with io.open(runner.pre_commit_path, 'w') as pre_commit_file:
|
||||
|
|
@ -398,28 +398,28 @@ PRE_INSTALLED = re.compile(
|
|||
|
||||
|
||||
def test_installs_hooks_with_hooks_True(
|
||||
tmpdir_factory,
|
||||
tempdir_factory,
|
||||
mock_out_store_directory,
|
||||
):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
install(Runner(path), hooks=True)
|
||||
ret, output = _get_commit_output(
|
||||
tmpdir_factory, home=mock_out_store_directory,
|
||||
tempdir_factory, home=mock_out_store_directory,
|
||||
)
|
||||
|
||||
assert ret == 0
|
||||
assert PRE_INSTALLED.match(output)
|
||||
|
||||
|
||||
def test_installed_from_venv(tmpdir_factory):
|
||||
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def test_installed_from_venv(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
install(Runner(path))
|
||||
# No environment so pre-commit is not on the path when running!
|
||||
# Should still pick up the python from when we installed
|
||||
ret, output = _get_commit_output(
|
||||
tmpdir_factory,
|
||||
tempdir_factory,
|
||||
env_base={
|
||||
'HOME': os.path.expanduser('~'),
|
||||
'TERM': os.environ.get('TERM', ''),
|
||||
|
|
@ -431,9 +431,9 @@ def test_installed_from_venv(tmpdir_factory):
|
|||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||
|
||||
|
||||
def _get_push_output(tmpdir_factory):
|
||||
def _get_push_output(tempdir_factory):
|
||||
# Don't want to write to home directory
|
||||
home = tmpdir_factory.get()
|
||||
home = tempdir_factory.get()
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=home)
|
||||
return cmd_output(
|
||||
'git', 'push', 'origin', 'HEAD:new_branch',
|
||||
|
|
@ -444,31 +444,31 @@ def _get_push_output(tmpdir_factory):
|
|||
)[:2]
|
||||
|
||||
|
||||
def test_pre_push_integration_failing(tmpdir_factory):
|
||||
upstream = make_consuming_repo(tmpdir_factory, 'failing_hook_repo')
|
||||
path = tmpdir_factory.get()
|
||||
def test_pre_push_integration_failing(tempdir_factory):
|
||||
upstream = make_consuming_repo(tempdir_factory, 'failing_hook_repo')
|
||||
path = tempdir_factory.get()
|
||||
cmd_output('git', 'clone', upstream, path)
|
||||
with cwd(path):
|
||||
install(Runner(path), hook_type='pre-push')
|
||||
# commit succeeds because pre-commit is only installed for pre-push
|
||||
assert _get_commit_output(tmpdir_factory)[0] == 0
|
||||
assert _get_commit_output(tempdir_factory)[0] == 0
|
||||
|
||||
retc, output = _get_push_output(tmpdir_factory)
|
||||
retc, output = _get_push_output(tempdir_factory)
|
||||
assert retc == 1
|
||||
assert 'Failing hook' in output
|
||||
assert 'Failed' in output
|
||||
assert 'hookid: failing_hook' in output
|
||||
|
||||
|
||||
def test_pre_push_integration_accepted(tmpdir_factory):
|
||||
upstream = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
path = tmpdir_factory.get()
|
||||
def test_pre_push_integration_accepted(tempdir_factory):
|
||||
upstream = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
path = tempdir_factory.get()
|
||||
cmd_output('git', 'clone', upstream, path)
|
||||
with cwd(path):
|
||||
install(Runner(path), hook_type='pre-push')
|
||||
assert _get_commit_output(tmpdir_factory)[0] == 0
|
||||
assert _get_commit_output(tempdir_factory)[0] == 0
|
||||
|
||||
retc, output = _get_push_output(tmpdir_factory)
|
||||
retc, output = _get_push_output(tempdir_factory)
|
||||
assert retc == 0
|
||||
assert 'Bash hook' in output
|
||||
assert 'Passed' in output
|
||||
|
|
|
|||
|
|
@ -27,15 +27,15 @@ from testing.fixtures import make_consuming_repo
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def repo_with_passing_hook(tmpdir_factory):
|
||||
git_path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
def repo_with_passing_hook(tempdir_factory):
|
||||
git_path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(git_path):
|
||||
yield git_path
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def repo_with_failing_hook(tmpdir_factory):
|
||||
git_path = make_consuming_repo(tmpdir_factory, 'failing_hook_repo')
|
||||
def repo_with_failing_hook(tempdir_factory):
|
||||
git_path = make_consuming_repo(tempdir_factory, 'failing_hook_repo')
|
||||
with cwd(git_path):
|
||||
yield git_path
|
||||
|
||||
|
|
@ -111,8 +111,8 @@ def test_run_all_hooks_failing(
|
|||
)
|
||||
|
||||
|
||||
def test_arbitrary_bytes_hook(tmpdir_factory, mock_out_store_directory):
|
||||
git_path = make_consuming_repo(tmpdir_factory, 'arbitrary_bytes_repo')
|
||||
def test_arbitrary_bytes_hook(tempdir_factory, mock_out_store_directory):
|
||||
git_path = make_consuming_repo(tempdir_factory, 'arbitrary_bytes_repo')
|
||||
with cwd(git_path):
|
||||
_test_run(git_path, {}, (b'\xe2\x98\x83\xb2\n',), 1, True)
|
||||
|
||||
|
|
@ -292,12 +292,12 @@ def test_multiple_hooks_same_id(
|
|||
|
||||
|
||||
def test_non_ascii_hook_id(
|
||||
repo_with_passing_hook, mock_out_store_directory, tmpdir_factory,
|
||||
repo_with_passing_hook, mock_out_store_directory, tempdir_factory,
|
||||
):
|
||||
with cwd(repo_with_passing_hook):
|
||||
install(Runner(repo_with_passing_hook))
|
||||
# Don't want to write to home directory
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=tmpdir_factory.get())
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=tempdir_factory.get())
|
||||
_, stdout, _ = cmd_output(
|
||||
sys.executable, '-m', 'pre_commit.main', 'run', '☃',
|
||||
env=env, retcode=None,
|
||||
|
|
@ -308,7 +308,7 @@ def test_non_ascii_hook_id(
|
|||
|
||||
|
||||
def test_stdout_write_bug_py26(
|
||||
repo_with_failing_hook, mock_out_store_directory, tmpdir_factory,
|
||||
repo_with_failing_hook, mock_out_store_directory, tempdir_factory,
|
||||
):
|
||||
with cwd(repo_with_failing_hook):
|
||||
# Add bash hook on there again
|
||||
|
|
@ -322,7 +322,7 @@ def test_stdout_write_bug_py26(
|
|||
install(Runner(repo_with_failing_hook))
|
||||
|
||||
# Don't want to write to home directory
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=tmpdir_factory.get())
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=tempdir_factory.get())
|
||||
# Have to use subprocess because pytest monkeypatches sys.stdout
|
||||
_, stdout, _ = cmd_output(
|
||||
'git', 'commit', '-m', 'Commit!',
|
||||
|
|
@ -344,10 +344,10 @@ def test_get_changed_files():
|
|||
assert files == ['CHANGELOG.md', 'setup.py']
|
||||
|
||||
|
||||
def test_lots_of_files(mock_out_store_directory, tmpdir_factory):
|
||||
def test_lots_of_files(mock_out_store_directory, tempdir_factory):
|
||||
# windows xargs seems to have a bug, here's a regression test for
|
||||
# our workaround
|
||||
git_path = make_consuming_repo(tmpdir_factory, 'python_hooks_repo')
|
||||
git_path = make_consuming_repo(tempdir_factory, 'python_hooks_repo')
|
||||
with cwd(git_path):
|
||||
# Override files so we run against them
|
||||
with io.open('.pre-commit-config.yaml', 'a+') as config_file:
|
||||
|
|
@ -362,7 +362,7 @@ def test_lots_of_files(mock_out_store_directory, tmpdir_factory):
|
|||
install(Runner(git_path))
|
||||
|
||||
# Don't want to write to home directory
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=tmpdir_factory.get())
|
||||
env = dict(os.environ, PRE_COMMIT_HOME=tempdir_factory.get())
|
||||
cmd_output(
|
||||
'git', 'commit', '-m', 'Commit!',
|
||||
# git commit puts pre-commit to stderr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue