mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Simplify the skip test to only test skipping
This commit is contained in:
parent
8ffd1f69d7
commit
6d40b2a38b
1 changed files with 2 additions and 14 deletions
|
|
@ -401,27 +401,15 @@ def test_skip_hook(cap_out, store, repo_with_passing_hook):
|
||||||
|
|
||||||
|
|
||||||
def test_skip_aliased_hook(cap_out, store, aliased_repo):
|
def test_skip_aliased_hook(cap_out, store, aliased_repo):
|
||||||
ret, printed = _do_run(
|
|
||||||
cap_out, store, aliased_repo,
|
|
||||||
run_opts(hook='bash_hook'),
|
|
||||||
{'SKIP': 'bash_hook'},
|
|
||||||
)
|
|
||||||
assert ret == 0
|
|
||||||
# Both hooks will run since they share the same ID
|
|
||||||
assert printed.count(b'Bash hook') == 2
|
|
||||||
for msg in (b'Bash hook', b'Skipped'):
|
|
||||||
assert msg in printed
|
|
||||||
|
|
||||||
ret, printed = _do_run(
|
ret, printed = _do_run(
|
||||||
cap_out, store, aliased_repo,
|
cap_out, store, aliased_repo,
|
||||||
run_opts(hook='foo_bash'),
|
run_opts(hook='foo_bash'),
|
||||||
{'SKIP': 'foo_bash'},
|
{'SKIP': 'foo_bash'},
|
||||||
)
|
)
|
||||||
assert ret == 0
|
assert ret == 0
|
||||||
# Only the aliased hook runs
|
# Only the aliased hook runs and is skipped
|
||||||
assert printed.count(b'Bash hook') == 1
|
|
||||||
for msg in (b'Bash hook', b'Skipped'):
|
for msg in (b'Bash hook', b'Skipped'):
|
||||||
assert msg in printed, printed
|
assert printed.count(msg) == 1
|
||||||
|
|
||||||
|
|
||||||
def test_hook_id_not_in_non_verbose_output(
|
def test_hook_id_not_in_non_verbose_output(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue