MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / test_fail_fast

Function test_fail_fast

tests/commands/run_test.py:1067–1076  ·  view source on GitHub ↗
(cap_out, store, repo_with_failing_hook)

Source from the content-addressed store, hash-verified

1065
1066
1067def test_fail_fast(cap_out, store, repo_with_failing_hook):
1068 with modify_config() as config:
1069 # More than one hook
1070 config['fail_fast'] = True
1071 config['repos'][0]['hooks'] *= 2
1072 stage_a_file()
1073
1074 ret, printed = _do_run(cap_out, store, repo_with_failing_hook, run_opts())
1075 # it should have only run one hook
1076 assert printed.count(b'Failing hook') == 1
1077
1078
1079def test_fail_fast_per_hook(cap_out, store, repo_with_failing_hook):

Callers

nothing calls this directly

Calls 4

modify_configFunction · 0.90
run_optsFunction · 0.90
stage_a_fileFunction · 0.85
_do_runFunction · 0.85

Tested by

no test coverage detected