1
0
Fork 0

Adding upstream version 2.15.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:30:35 +01:00
parent dcfd04081c
commit d3b459fcc0
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
38 changed files with 396 additions and 59 deletions

View file

@ -1,7 +1,4 @@
import pytest
import pre_commit.constants as C
from pre_commit.clientlib import InvalidConfigError
from pre_commit.commands.migrate_config import migrate_config
@ -130,13 +127,3 @@ def test_migrate_config_sha_to_rev(tmpdir):
' rev: v1.2.0\n'
' hooks: []\n'
)
@pytest.mark.parametrize('contents', ('', '\n'))
def test_migrate_config_invalid_configuration(tmpdir, contents):
cfg = tmpdir.join(C.CONFIG_FILE)
cfg.write(contents)
with tmpdir.as_cwd(), pytest.raises(InvalidConfigError):
migrate_config(C.CONFIG_FILE)
# even though the config is invalid, this should be a noop
assert cfg.read() == contents