From b312063051e60bf54f7f8fe84285e9bd9340f69b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 25 Mar 2018 17:12:49 -0700 Subject: [PATCH] Always load the README as UTF-8 --- tests/readme_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/readme_test.py b/tests/readme_test.py index 4d4c972..b2d03b3 100644 --- a/tests/readme_test.py +++ b/tests/readme_test.py @@ -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