diff options
Diffstat (limited to 'tests/test_examplefiles.py')
-rw-r--r-- | tests/test_examplefiles.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py index 79b854ad..469066da 100644 --- a/tests/test_examplefiles.py +++ b/tests/test_examplefiles.py @@ -6,6 +6,7 @@ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ +from __future__ import print_function import os import pprint @@ -32,7 +33,7 @@ def test_example_files(): if not os.path.isfile(absfn): continue - print absfn + print(absfn) code = open(absfn, 'rb').read() try: code = code.decode('utf-8') @@ -80,8 +81,8 @@ def check_lexer(lx, absfn, outfn): (lx, absfn, val, len(u''.join(ntext))) tokens.append((type, val)) if u''.join(ntext) != text: - print '\n'.join(difflib.unified_diff(u''.join(ntext).splitlines(), - text.splitlines())) + print('\n'.join(difflib.unified_diff(u''.join(ntext).splitlines(), + text.splitlines()))) raise AssertionError('round trip failed for ' + absfn) # check output against previous run if enabled @@ -103,6 +104,6 @@ def check_lexer(lx, absfn, outfn): if stored_tokens != tokens: f1 = pprint.pformat(stored_tokens) f2 = pprint.pformat(tokens) - print '\n'.join(difflib.unified_diff(f1.splitlines(), - f2.splitlines())) + print('\n'.join(difflib.unified_diff(f1.splitlines(), + f2.splitlines()))) assert False, absfn |