Skip to content

Commit

Permalink
Fix errors with Python2 in test_files_encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaverde committed Nov 25, 2016
1 parent 2bb47cf commit 18b297a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spyder/utils/tests/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os

from spyder.utils.encoding import is_text_file, get_coding
from spyder.py3compat import PY2

__location__ = os.path.realpath(os.path.join(os.getcwd(),
os.path.dirname(__file__)))
Expand All @@ -31,6 +32,8 @@ def test_is_text_file(tmpdir):
def test_files_encodings(expected_encoding, text_file):
with open(os.path.join(__location__, text_file), 'rb') as f:
text = f.read()
if PY2:
text = str(text)
assert get_coding(text) == expected_encoding


Expand Down

0 comments on commit 18b297a

Please sign in to comment.