From e8f5553ee8d21343057c64c89987095e9f731112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Jourdois?= Date: Sat, 31 Oct 2015 16:45:50 +0100 Subject: [PATCH] Open file as utf-8 during tests (copyright symbol) io.open works the same in python2 and in python3 --- pygal/test/test_graph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pygal/test/test_graph.py b/pygal/test/test_graph.py index ea8c972..8a88246 100644 --- a/pygal/test/test_graph.py +++ b/pygal/test/test_graph.py @@ -24,6 +24,7 @@ import pygal import uuid import sys import pytest +import io from pygal.graph.map import BaseMap from pygal.util import cut from pygal._compat import u @@ -53,7 +54,7 @@ def test_render_to_file(Chart, datas): chart = Chart() chart = make_data(chart, datas) chart.render_to_file(file_name) - with open(file_name) as f: + with io.open(file_name, encoding="utf-8") as f: assert 'pygal' in f.read() os.remove(file_name)