mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
fix excess whitespace in traceback in error
This commit is contained in:
parent
918821b7e0
commit
3a0406847b
6 changed files with 59 additions and 48 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import os.path
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
from typing import Any
|
||||
|
|
@ -8,6 +7,7 @@ from unittest import mock
|
|||
|
||||
import cfgv
|
||||
import pytest
|
||||
import re_assert
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.clientlib import CONFIG_SCHEMA
|
||||
|
|
@ -843,12 +843,12 @@ def test_too_new_version(tempdir_factory, store, fake_log_handler):
|
|||
with pytest.raises(SystemExit):
|
||||
_get_hook(config, store, 'bash_hook')
|
||||
msg = fake_log_handler.handle.call_args[0][0].msg
|
||||
assert re.match(
|
||||
pattern = re_assert.Matches(
|
||||
r'^The hook `bash_hook` requires pre-commit version 999\.0\.0 but '
|
||||
r'version \d+\.\d+\.\d+ is installed. '
|
||||
r'Perhaps run `pip install --upgrade pre-commit`\.$',
|
||||
msg,
|
||||
)
|
||||
pattern.assert_matches(msg)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('version', ('0.1.0', C.VERSION))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue