diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-04 03:57:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-04 03:57:54 +0000 |
commit | fc1651ef0b7ccedc604b28d5893f5cd486cd4091 (patch) | |
tree | 3ea033abb546734a46b2e947756e0d9f792b0e80 /tests/commands/run_test.py | |
parent | Releasing debian version 2.15.0-1. (diff) | |
download | pre-commit-fc1651ef0b7ccedc604b28d5893f5cd486cd4091.tar.xz pre-commit-fc1651ef0b7ccedc604b28d5893f5cd486cd4091.zip |
Merging upstream version 2.16.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/commands/run_test.py')
-rw-r--r-- | tests/commands/run_test.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index 8c15395..3a6fa2a 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -985,6 +985,18 @@ def test_fail_fast(cap_out, store, repo_with_failing_hook): assert printed.count(b'Failing hook') == 1 +def test_fail_fast_per_hook(cap_out, store, repo_with_failing_hook): + with modify_config() as config: + # More than one hook + config['repos'][0]['hooks'] *= 2 + config['repos'][0]['hooks'][0]['fail_fast'] = True + stage_a_file() + + ret, printed = _do_run(cap_out, store, repo_with_failing_hook, run_opts()) + # it should have only run one hook + assert printed.count(b'Failing hook') == 1 + + def test_classifier_removes_dne(): classifier = Classifier(('this_file_does_not_exist',)) assert classifier.filenames == [] |