mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
Increase robustness of tests involving git
1. Disable automatic `git commit` GPG-signing, since that requires interaction. This issue was encountered in practice by me, causing spurious test failures 2. In case path operands could turn out to start with dashes, escape the operand list with '--'.
This commit is contained in:
parent
6b1aa19425
commit
9e89b7616a
4 changed files with 23 additions and 16 deletions
|
|
@ -10,5 +10,5 @@ from pre_commit_hooks.util import cmd_output
|
|||
@pytest.yield_fixture
|
||||
def temp_git_dir(tmpdir):
|
||||
git_dir = tmpdir.join('gits')
|
||||
cmd_output('git', 'init', git_dir.strpath)
|
||||
cmd_output('git', 'init', '--', git_dir.strpath)
|
||||
yield git_dir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue