Simplify the skip test to only test skipping

This commit is contained in:
Anthony Sottile 2018-12-27 09:24:41 -08:00 committed by GitHub
parent 8ffd1f69d7
commit 6d40b2a38b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(