mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add expected behaviour for failure to find pre_commit.
This commit is contained in:
parent
4b43fd8cdc
commit
39470c98ca
1 changed files with 18 additions and 0 deletions
|
|
@ -71,3 +71,21 @@ def test_install_idempotent(tmpdir_factory):
|
||||||
|
|
||||||
output = _get_commit_output(tmpdir_factory)
|
output = _get_commit_output(tmpdir_factory)
|
||||||
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
assert NORMAL_PRE_COMMIT_RUN.match(output)
|
||||||
|
|
||||||
|
|
||||||
|
def test_environment_not_sourced(tmpdir_factory):
|
||||||
|
path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||||
|
with local.cwd(path):
|
||||||
|
assert install(Runner(path)) == 0
|
||||||
|
|
||||||
|
ret, stdout, stderr = local['git'].run(
|
||||||
|
['commit', '--allow-empty', '-m', 'foo'],
|
||||||
|
env={},
|
||||||
|
retcode=None,
|
||||||
|
)
|
||||||
|
assert ret == 1
|
||||||
|
assert stdout == ''
|
||||||
|
assert stderr == (
|
||||||
|
'`pre-commit` not found. '
|
||||||
|
'Did you forget to activate your virtualenv?\n'
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue