From 6d40b2a38b274e7a561322749702a00703432a66 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 27 Dec 2018 09:24:41 -0800 Subject: [PATCH] Simplify the skip test to only test skipping --- tests/commands/run_test.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index 37e17a52..bc891c0c 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -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): - 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( cap_out, store, aliased_repo, run_opts(hook='foo_bash'), {'SKIP': 'foo_bash'}, ) assert ret == 0 - # Only the aliased hook runs - assert printed.count(b'Bash hook') == 1 + # Only the aliased hook runs and is 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(