Specify encoding for test files

"utf-8" is not the default encoding on Windows, causing tests to fail
This commit is contained in:
Unrud 2018-04-21 16:01:55 +02:00
parent 3e02134547
commit ae8e10d900

View File

@ -30,7 +30,8 @@ EXAMPLES_FOLDER = os.path.join(os.path.dirname(__file__), "static")
def get_file_content(file_name): def get_file_content(file_name):
try: try:
with open(os.path.join(EXAMPLES_FOLDER, file_name)) as fd: with open(os.path.join(EXAMPLES_FOLDER, file_name),
encoding="utf-8") as fd:
return fd.read() return fd.read()
except IOError: except IOError:
print("Couldn't open the file %s" % file_name) print("Couldn't open the file %s" % file_name)