mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
add pre-commit hazmat
This commit is contained in:
parent
9c7ea88ab9
commit
bdf68790b7
7 changed files with 243 additions and 2 deletions
|
|
@ -506,3 +506,14 @@ def test_args_with_spaces_and_quotes(tmp_path):
|
|||
|
||||
expected = b"['i have spaces', 'and\"\\'quotes', '$and !this']\n"
|
||||
assert ret == (0, expected)
|
||||
|
||||
|
||||
def test_hazmat(tmp_path):
|
||||
ret = run_language(
|
||||
tmp_path, unsupported,
|
||||
f'pre-commit hazmat ignore-exit-code {shlex.quote(sys.executable)} '
|
||||
f"-c 'import sys; raise SystemExit(sys.argv[1:])'",
|
||||
('f1', 'f2'),
|
||||
)
|
||||
expected = b"['f1', 'f2']\n"
|
||||
assert ret == (0, expected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue