Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d40b2a

Browse files
authored
Simplify the skip test to only test skipping
1 parent 8ffd1f6 commit 6d40b2a

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

tests/commands/run_test.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,27 +401,15 @@ def test_skip_hook(cap_out, store, repo_with_passing_hook):
401401

402402

403403
def test_skip_aliased_hook(cap_out, store, aliased_repo):
404-
ret, printed = _do_run(
405-
cap_out, store, aliased_repo,
406-
run_opts(hook='bash_hook'),
407-
{'SKIP': 'bash_hook'},
408-
)
409-
assert ret == 0
410-
# Both hooks will run since they share the same ID
411-
assert printed.count(b'Bash hook') == 2
412-
for msg in (b'Bash hook', b'Skipped'):
413-
assert msg in printed
414-
415404
ret, printed = _do_run(
416405
cap_out, store, aliased_repo,
417406
run_opts(hook='foo_bash'),
418407
{'SKIP': 'foo_bash'},
419408
)
420409
assert ret == 0
421-
# Only the aliased hook runs
422-
assert printed.count(b'Bash hook') == 1
410+
# Only the aliased hook runs and is skipped
423411
for msg in (b'Bash hook', b'Skipped'):
424-
assert msg in printed, printed
412+
assert printed.count(msg) == 1
425413

426414

427415
def test_hook_id_not_in_non_verbose_output(

0 commit comments

Comments
 (0)