summaryrefslogtreecommitdiff
path: root/tests/test_basic_api.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-11-25 21:50:50 +0100
committergbrandl <devnull@localhost>2008-11-25 21:50:50 +0100
commit17b1308ff5e77b55283f11405b053aaa8b4170b8 (patch)
tree417142f4f0f11a4b1f60529ee4cf82f72d08c7a1 /tests/test_basic_api.py
parentfcfeeb36e6c4df0cb6b51794be6e5d433f1e5fd9 (diff)
downloadpygments-17b1308ff5e77b55283f11405b053aaa8b4170b8.tar.gz
Explicitly use binary file mode.
Diffstat (limited to 'tests/test_basic_api.py')
-rw-r--r--tests/test_basic_api.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py
index 429e0823..5944eee5 100644
--- a/tests/test_basic_api.py
+++ b/tests/test_basic_api.py
@@ -94,7 +94,7 @@ class FiltersTest(unittest.TestCase):
for x in filters.FILTERS.keys():
lx = lexers.PythonLexer()
lx.add_filter(x, **filter_args.get(x, {}))
- text = open(TESTFILE).read().decode('utf-8')
+ text = open(TESTFILE, 'rb').read().decode('utf-8')
tokens = list(lx.get_tokens(text))
roundtext = ''.join([t[1] for t in tokens])
if x not in ('whitespace', 'keywordcase'):
@@ -110,14 +110,14 @@ class FiltersTest(unittest.TestCase):
def test_whitespace(self):
lx = lexers.PythonLexer()
lx.add_filter('whitespace', spaces='%')
- text = open(TESTFILE).read().decode('utf-8')
+ text = open(TESTFILE, 'rb').read().decode('utf-8')
lxtext = ''.join([t[1] for t in list(lx.get_tokens(text))])
self.failIf(' ' in lxtext)
def test_keywordcase(self):
lx = lexers.PythonLexer()
lx.add_filter('keywordcase', case='capitalize')
- text = open(TESTFILE).read().decode('utf-8')
+ text = open(TESTFILE, 'rb').read().decode('utf-8')
lxtext = ''.join([t[1] for t in list(lx.get_tokens(text))])
self.assert_('Def' in lxtext and 'Class' in lxtext)