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:
Sander Maijers 2016-06-12 18:49:44 +02:00
parent 6b1aa19425
commit 9e89b7616a
No known key found for this signature in database
GPG key ID: 2E974A73F1B0F2F7
4 changed files with 23 additions and 16 deletions

View file

@ -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