mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
test fail language inline
This commit is contained in:
parent
4bd1677cda
commit
4fdfb25a52
2 changed files with 14 additions and 24 deletions
|
|
@ -330,30 +330,6 @@ def test_repository_state_compatibility(tempdir_factory, store, v):
|
|||
assert _hook_installed(hook) is True
|
||||
|
||||
|
||||
def test_fail_hooks(store):
|
||||
config = {
|
||||
'repo': 'local',
|
||||
'hooks': [{
|
||||
'id': 'fail',
|
||||
'name': 'fail',
|
||||
'language': 'fail',
|
||||
'entry': 'make sure to name changelogs as .rst!',
|
||||
'files': r'changelog/.*(?<!\.rst)$',
|
||||
}],
|
||||
}
|
||||
hook = _get_hook(config, store, 'fail')
|
||||
ret, out = _hook_run(
|
||||
hook, ('changelog/123.bugfix', 'changelog/wat'), color=False,
|
||||
)
|
||||
assert ret == 1
|
||||
assert out == (
|
||||
b'make sure to name changelogs as .rst!\n'
|
||||
b'\n'
|
||||
b'changelog/123.bugfix\n'
|
||||
b'changelog/wat\n'
|
||||
)
|
||||
|
||||
|
||||
def test_unknown_keys(store, caplog):
|
||||
config = {
|
||||
'repo': 'local',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue