commit 8cdca6d7dcd8992e166f13e2e7c639cb41db833c Author: Michael Simacek msimacek@redhat.com Date: Mon Feb 16 18:43:38 2015 +0100
Set UTF-8 encoding in pom_editor tests
test/pom_macros_test.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) --- diff --git a/test/pom_macros_test.py b/test/pom_macros_test.py index 3ac709a..4f8c4c9 100644 --- a/test/pom_macros_test.py +++ b/test/pom_macros_test.py @@ -1,5 +1,6 @@ import unittest import os +import io
from shutil import copytree from shutil import rmtree @@ -37,11 +38,11 @@ def check_result(pom_path): return report, res
def get_result_literally(pom_path): - with open(pom_path, 'r') as gotfile: + with io.open(pom_path, 'r', encoding='UTF-8') as gotfile: got = gotfile.read().split('\n')
wantpath = '{pom}-want'.format(pom=os.path.basename(pom_path)) - with open(wantpath, 'r') as wantfile: + with io.open(wantpath, 'r', encoding='UTF-8') as wantfile: want = wantfile.read().split('\n') return got, want