(tempdir_factory, store, caplog)
| 393 | |
| 394 | |
| 395 | def test_hook_id_not_present(tempdir_factory, store, caplog): |
| 396 | path = make_repo(tempdir_factory, 'script_hooks_repo') |
| 397 | config = make_config_from_repo(path) |
| 398 | config['hooks'][0]['id'] = 'i-dont-exist' |
| 399 | with pytest.raises(SystemExit): |
| 400 | _get_hook(config, store, 'i-dont-exist') |
| 401 | _, msg = caplog.messages |
| 402 | assert msg == ( |
| 403 | f'`i-dont-exist` is not present in repository file://{path}. ' |
| 404 | f'Typo? Perhaps it is introduced in a newer version? ' |
| 405 | f'Often `pre-commit autoupdate` fixes this.' |
| 406 | ) |
| 407 | |
| 408 | |
| 409 | def test_manifest_hooks(tempdir_factory, store): |
nothing calls this directly
no test coverage detected