mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
xargs returns nonzero for negate + not found exe (fixes pcre + not found #447)
This commit is contained in:
parent
0e2c3c1ff9
commit
a157e1a63f
7 changed files with 49 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ import random
|
|||
import pytest
|
||||
|
||||
from pre_commit.util import clean_path_on_failure
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import cwd
|
||||
from pre_commit.util import memoize_by_cwd
|
||||
from pre_commit.util import tmpdir
|
||||
|
|
@ -81,3 +82,9 @@ def test_tmpdir():
|
|||
with tmpdir() as tempdir:
|
||||
assert os.path.exists(tempdir)
|
||||
assert not os.path.exists(tempdir)
|
||||
|
||||
|
||||
def test_cmd_output_exe_not_found():
|
||||
ret, out, _ = cmd_output('i-dont-exist', retcode=None)
|
||||
assert ret == 1
|
||||
assert out == 'Executable `i-dont-exist` not found'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue