diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-06 19:22:03 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-06 19:24:08 +0100 |
commit | e972bc97a47a57359fc6793f61e0022fd123b5d5 (patch) | |
tree | 7c46ad89c872c863e91e20dca5ea9ebf705b11b8 /tests/component | |
parent | b1a03534a0bde38a21c844302eff1a0a0bd2e863 (diff) |
tests: use encoding when opening files for checks and fixtures
so we don't fail on non utf-8 locales
Diffstat (limited to 'tests/component')
-rw-r--r-- | tests/component/__init__.py | 2 | ||||
-rw-r--r-- | tests/component/deb/test_dch.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/component/__init__.py b/tests/component/__init__.py index 7f9c7ff9..0dbbd95e 100644 --- a/tests/component/__init__.py +++ b/tests/component/__init__.py @@ -227,7 +227,7 @@ class ComponentTestBase(unittest.TestCase, GbpLogTester): This assumes the hook was set too printenv > hookname.out """ - with open('%s.out' % name) as f: + with open('%s.out' % name, encoding='utf-8') as f: parsed = dict([line[:-1].split('=', 1) for line in f.readlines() if line.startswith("GBP_")]) for var in expected: diff --git a/tests/component/deb/test_dch.py b/tests/component/deb/test_dch.py index 053597e6..3d969b14 100644 --- a/tests/component/deb/test_dch.py +++ b/tests/component/deb/test_dch.py @@ -57,7 +57,7 @@ class TestDch(ComponentTestBase): repo.commit_all(msg="test customizations") ok_(dch(['arg0', '-S', '-a', '--customizations=customizations.py']) == 0, "dch did no succeed as expected") - with open("debian/changelog") as f: + with open("debian/changelog", encoding='utf-8') as f: cl = f.read() ok_('* testentry\n' in cl) del gbp.scripts.dch.user_customizations['format_changelog_entry'] |