(cap_out, store, repo_with_passing_hook)
| 948 | |
| 949 | |
| 950 | def test_local_hook_fails(cap_out, store, repo_with_passing_hook): |
| 951 | config = { |
| 952 | 'repo': 'local', |
| 953 | 'hooks': [{ |
| 954 | 'id': 'no-todo', |
| 955 | 'name': 'No TODO', |
| 956 | 'entry': 'sh -c "! grep -iI todo $@" --', |
| 957 | 'language': 'system', |
| 958 | }], |
| 959 | } |
| 960 | add_config_to_repo(repo_with_passing_hook, config) |
| 961 | |
| 962 | with open('placeholder.py', 'w') as staged_file: |
| 963 | staged_file.write('"""TODO: something"""\n') |
| 964 | cmd_output('git', 'add', 'placeholder.py') |
| 965 | |
| 966 | _test_run( |
| 967 | cap_out, |
| 968 | store, |
| 969 | repo_with_passing_hook, |
| 970 | opts={}, |
| 971 | expected_outputs=[b''], |
| 972 | expected_ret=1, |
| 973 | stage=False, |
| 974 | ) |
| 975 | |
| 976 | |
| 977 | def test_meta_hook_passes(cap_out, store, repo_with_passing_hook): |
nothing calls this directly
no test coverage detected