mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add a test to validate that cfgv.WarnAdditionalKeys working as expected in the relevant config schemas
This commit is contained in:
parent
217d31ec1c
commit
ba7760b705
2 changed files with 19 additions and 1 deletions
|
|
@ -305,3 +305,12 @@ def test_minimum_pre_commit_version_failing():
|
|||
def test_minimum_pre_commit_version_passing():
|
||||
cfg = {'repos': [], 'minimum_pre_commit_version': '0'}
|
||||
cfgv.validate(cfg, CONFIG_SCHEMA)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('schema', (CONFIG_SCHEMA, CONFIG_REPO_DICT))
|
||||
def test_warn_additional(schema):
|
||||
allowed_keys = {item.key for item in schema.items if hasattr(item, 'key')}
|
||||
warn_additional, = [
|
||||
x for x in schema.items if isinstance(x, cfgv.WarnAdditionalKeys)
|
||||
]
|
||||
assert allowed_keys == set(warn_additional.keys)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue