pre-commit-hooks/tests/readme_test.py
Sviatoslav Sydorenko 51f8cc8ff0 Use open built-in to open files
* This makes Python 3 not raise UnicodeDecodeError when reading files
2016-12-29 18:53:57 +02:00

11 lines
312 B
Python

from __future__ import absolute_import
from __future__ import unicode_literals
import yaml
def test_readme_contains_all_hooks():
readme_contents = open('README.md').read()
hooks = yaml.load(open('hooks.yaml').read())
for hook in hooks:
assert '`{0}`'.format(hook['id']) in readme_contents