mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +00:00
Remove @entry decorator (and misc cleanup)
This commit is contained in:
parent
9bfa01da81
commit
2f1d2bbe5b
13 changed files with 25 additions and 88 deletions
|
|
@ -1,27 +0,0 @@
|
|||
import mock
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
from pre_commit_hooks.util import entry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def entry_func():
|
||||
@entry
|
||||
def func(argv):
|
||||
return argv
|
||||
|
||||
return func
|
||||
|
||||
|
||||
def test_explicitly_passed_argv_are_passed(entry_func):
|
||||
input = object()
|
||||
ret = entry_func(input)
|
||||
assert ret is input
|
||||
|
||||
|
||||
def test_no_arguments_passed_uses_argv(entry_func):
|
||||
argv = [1, 2, 3, 4]
|
||||
with mock.patch.object(sys, 'argv', argv):
|
||||
ret = entry_func()
|
||||
assert ret == argv[1:]
|
||||
Loading…
Add table
Add a link
Reference in a new issue