Merge pull request #513 from pre-commit/always_run_regression

Fix regression in 0.13.5 with always_run + files
This commit is contained in:
Anthony Sottile 2017-03-27 07:53:47 -07:00 committed by GitHub
commit b89962e1dd
2 changed files with 15 additions and 1 deletions

View file

@ -38,7 +38,7 @@ MANIFEST_HOOK_DICT = schema.Map(
schema.Conditional(
'files', schema.check_and(schema.check_string, schema.check_regex),
condition_key='always_run', condition_value=False, ensure_absent=True,
condition_key='always_run', condition_value=False,
),
schema.Optional(

View file

@ -187,6 +187,20 @@ def test_validate_manifest_main(args, expected_output):
}],
True,
),
(
# A regression in 0.13.5: always_run and files are permissible
# together (but meaningless). In a future version upgrade this to
# an error
[{
'id': 'a',
'name': 'b',
'entry': 'c',
'language': 'python',
'files': '',
'always_run': True,
}],
True,
),
)
)
def test_valid_manifests(manifest_obj, expected):