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

@ -41,7 +41,7 @@ def test_file_conflicts_with_committed_file(temp_git_dir):
with temp_git_dir.as_cwd():
temp_git_dir.join('f.py').write("print('hello world')")
cmd_output('git', 'add', 'f.py')
cmd_output('git', 'commit', '--no-verify', '-m', 'Add f.py')
cmd_output('git', 'commit', '--no-gpg-sign', '-n', '-m', 'Add f.py')
temp_git_dir.join('F.py').write("print('hello world')")
cmd_output('git', 'add', 'F.py')