Merge pull request #277 from pre-commit/fix_readme_test_non_utf8

Always load the README as UTF-8
This commit is contained in:
Anthony Sottile 2018-03-25 17:22:37 -07:00 committed by GitHub
commit 16ff195820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,9 @@ import yaml
def test_readme_contains_all_hooks():
readme_contents = io.open('README.md').read()
hooks = yaml.load(io.open('hooks.yaml').read())
with io.open('README.md', encoding='UTF-8') as f:
readme_contents = f.read()
with io.open('.pre-commit-hooks.yaml', encoding='UTF-8') as f:
hooks = yaml.load(f)
for hook in hooks:
assert '`{}`'.format(hook['id']) in readme_contents