diff options
Diffstat (limited to 'scss/tests/test_files.py')
-rw-r--r-- | scss/tests/test_files.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scss/tests/test_files.py b/scss/tests/test_files.py index c5df737..6bd39de 100644 --- a/scss/tests/test_files.py +++ b/scss/tests/test_files.py @@ -13,9 +13,15 @@ from __future__ import absolute_import, unicode_literals import os.path import logging +import six + import scss +if six.PY2: + from codecs import open + + console = logging.StreamHandler() logger = logging.getLogger('scss') logger.setLevel(logging.ERROR) @@ -25,13 +31,10 @@ logger.addHandler(console) def test_pair_programmatic(scss_file_pair): scss_fn, css_fn = scss_file_pair - with open(scss_fn) as fh: + with open(scss_fn, 'rb') as fh: source = fh.read() - try: - with open(css_fn) as fh: - expected = fh.read().decode('utf-8') - except IOError: - expected = '' + with open(css_fn, 'r', encoding='utf8') as fh: + expected = fh.read() directory, _ = os.path.split(scss_fn) include_dir = os.path.join(directory, 'include') |