mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-10 05:14:18 +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
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue