mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Modify a test to make sure arguments are getting passed correctly
This commit is contained in:
parent
afed660077
commit
a1ba715b50
2 changed files with 5 additions and 3 deletions
|
|
@ -67,6 +67,8 @@ setup(
|
||||||
local.path('__init__.py').write('')
|
local.path('__init__.py').write('')
|
||||||
local.path('main.py').write("""
|
local.path('main.py').write("""
|
||||||
def func():
|
def func():
|
||||||
|
import sys
|
||||||
|
print repr(sys.argv[1:])
|
||||||
print 'Hello World'
|
print 'Hello World'
|
||||||
return 0
|
return 0
|
||||||
""")
|
""")
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,10 @@ def test_install_python_repo_in_env(python_pre_commit_git_repo, config_for_pytho
|
||||||
def test_run_a_python_hook(config_for_python_pre_commit_git_repo):
|
def test_run_a_python_hook(config_for_python_pre_commit_git_repo):
|
||||||
repo = Repository(config_for_python_pre_commit_git_repo)
|
repo = Repository(config_for_python_pre_commit_git_repo)
|
||||||
repo.install()
|
repo.install()
|
||||||
ret = repo.run_hook('foo', [])
|
ret = repo.run_hook('foo', ['/dev/null'])
|
||||||
|
|
||||||
assert ret[0] == 0
|
assert ret[0] == 0
|
||||||
assert ret[1] == 'Hello World\n'
|
assert ret[1] == "['/dev/null']\nHello World\n"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue