mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
fix per-hook fail_fast to not fail on previous failures
This commit is contained in:
parent
716da1e49c
commit
fc622159a6
2 changed files with 17 additions and 1 deletions
|
|
@ -1088,6 +1088,22 @@ def test_fail_fast_per_hook(cap_out, store, repo_with_failing_hook):
|
|||
assert printed.count(b'Failing hook') == 1
|
||||
|
||||
|
||||
def test_fail_fast_not_prev_failures(cap_out, store, repo_with_failing_hook):
|
||||
with modify_config() as config:
|
||||
config['repos'].append({
|
||||
'repo': 'meta',
|
||||
'hooks': [
|
||||
{'id': 'identity', 'fail_fast': True},
|
||||
{'id': 'identity', 'name': 'run me!'},
|
||||
],
|
||||
})
|
||||
stage_a_file()
|
||||
|
||||
ret, printed = _do_run(cap_out, store, repo_with_failing_hook, run_opts())
|
||||
# should still run the last hook since the `fail_fast` one didn't fail
|
||||
assert printed.count(b'run me!') == 1
|
||||
|
||||
|
||||
def test_classifier_removes_dne():
|
||||
classifier = Classifier(('this_file_does_not_exist',))
|
||||
assert classifier.filenames == []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue