mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04: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('main.py').write("""
|
||||
def func():
|
||||
import sys
|
||||
print repr(sys.argv[1:])
|
||||
print 'Hello World'
|
||||
return 0
|
||||
""")
|
||||
|
|
@ -142,4 +144,4 @@ def config_for_python_pre_commit_git_repo(python_pre_commit_git_repo):
|
|||
|
||||
jsonschema.validate([config], CONFIG_JSON_SCHEMA)
|
||||
|
||||
return config
|
||||
return config
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
repo = Repository(config_for_python_pre_commit_git_repo)
|
||||
repo.install()
|
||||
ret = repo.run_hook('foo', [])
|
||||
ret = repo.run_hook('foo', ['/dev/null'])
|
||||
|
||||
assert ret[0] == 0
|
||||
assert ret[1] == 'Hello World\n'
|
||||
assert ret[1] == "['/dev/null']\nHello World\n"
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue