(cap_out, store, in_git_dir)
| 266 | |
| 267 | |
| 268 | def test_global_files(cap_out, store, in_git_dir): |
| 269 | config = { |
| 270 | 'files': r'^bar\.py$', |
| 271 | 'repos': [{'repo': 'meta', 'hooks': [{'id': 'identity'}]}], |
| 272 | } |
| 273 | write_config('.', config) |
| 274 | open('foo.py', 'a').close() |
| 275 | open('bar.py', 'a').close() |
| 276 | cmd_output('git', 'add', '.') |
| 277 | opts = run_opts(verbose=True) |
| 278 | ret, printed = _do_run(cap_out, store, str(in_git_dir), opts) |
| 279 | assert ret == 0 |
| 280 | # Does not contain foo.py since it was excluded |
| 281 | assert printed.startswith(f'identity{"." * 65}Passed\n'.encode()) |
| 282 | assert printed.endswith(b'\n\nbar.py\n\n') |
| 283 | |
| 284 | |
| 285 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected