mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
Add support for meta hooks
This commit is contained in:
parent
39d5205e31
commit
88c676a7c1
6 changed files with 130 additions and 1 deletions
|
|
@ -645,6 +645,31 @@ def test_local_hook_fails(
|
|||
)
|
||||
|
||||
|
||||
def test_meta_hook_passes(
|
||||
cap_out, repo_with_passing_hook, mock_out_store_directory,
|
||||
):
|
||||
config = OrderedDict((
|
||||
('repo', 'meta'),
|
||||
(
|
||||
'hooks', (
|
||||
OrderedDict((
|
||||
('id', 'test-hook'),
|
||||
)),
|
||||
),
|
||||
),
|
||||
))
|
||||
add_config_to_repo(repo_with_passing_hook, config)
|
||||
|
||||
_test_run(
|
||||
cap_out,
|
||||
repo_with_passing_hook,
|
||||
opts={'verbose': True},
|
||||
expected_outputs=[b'Hello World!'],
|
||||
expected_ret=0,
|
||||
stage=False,
|
||||
)
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def modified_config_repo(repo_with_passing_hook):
|
||||
with modify_config(repo_with_passing_hook, commit=False) as config:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue