summaryrefslogtreecommitdiffstats
path: root/tests/commands/run_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:05:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:05:33 +0000
commita1993dd02769ce30561f5311c53d00676fcce829 (patch)
tree67ea3d6333c516cc6d972345c9948a572606752f /tests/commands/run_test.py
parentAdding upstream version 3.6.2. (diff)
downloadpre-commit-a1993dd02769ce30561f5311c53d00676fcce829.tar.xz
pre-commit-a1993dd02769ce30561f5311c53d00676fcce829.zip
Adding upstream version 3.7.0.upstream/3.7.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.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py
index e36a3ca..50a20f3 100644
--- a/tests/commands/run_test.py
+++ b/tests/commands/run_test.py
@@ -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 == []