summaryrefslogtreecommitdiff
path: root/tests/test_exceptions
diff options
context:
space:
mode:
authorCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:27 +0100
committerCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:27 +0100
commit9789a96ca9aab44bd71fdcfc5c0bed1ef7cf0838 (patch)
tree543718d130e12237d431dc61a3ce62769ff1c312 /tests/test_exceptions
parent4bdb495a250dc8b44309a8d158fb60a8106e3287 (diff)
downloadpaste-9789a96ca9aab44bd71fdcfc5c0bed1ef7cf0838.tar.gz
Python 3: add parenthesis to print() to support Python 2 and Python 3
Use also "from __future__ import print_function".
Diffstat (limited to 'tests/test_exceptions')
-rw-r--r--tests/test_exceptions/test_formatter.py10
-rw-r--r--tests/test_exceptions/test_httpexceptions.py4
-rw-r--r--tests/test_exceptions/test_reporter.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_exceptions/test_formatter.py b/tests/test_exceptions/test_formatter.py
index 2fe4528..3d5bdad 100644
--- a/tests/test_exceptions/test_formatter.py
+++ b/tests/test_exceptions/test_formatter.py
@@ -74,7 +74,7 @@ def test_content():
raise_error()
except:
result = format(f)
- print result
+ print(result)
assert 'test_object' in result
assert 'http://whatever.com' in result
assert 'This is some supplemental information' in result
@@ -103,7 +103,7 @@ def test_hide():
hide(True, raise_error)
except:
result = format(f)
- print result
+ print(result)
assert 'in hide_inner' not in result
assert 'inner(*args, **kw)' not in result
else:
@@ -112,7 +112,7 @@ def test_hide():
def print_diff(s1, s2):
differ = difflib.Differ()
result = list(differ.compare(s1.splitlines(), s2.splitlines()))
- print '\n'.join(result)
+ print('\n'.join(result))
def test_hide_supppressed():
"""
@@ -153,7 +153,7 @@ def test_hide_after():
raise_error)
except:
result = format(f)
- print strip_html(result).encode('ascii', 'replace')
+ print(strip_html(result).encode('ascii', 'replace'))
assert 'AABB' in result
assert 'CCDD' not in result
assert 'raise_error' in result
@@ -169,7 +169,7 @@ def test_hide_before():
raise_error)
except:
result = format(f)
- print result
+ print(result)
assert 'AABB' not in result
assert 'raise_error' in result
else:
diff --git a/tests/test_exceptions/test_httpexceptions.py b/tests/test_exceptions/test_httpexceptions.py
index c833eae..08e23d4 100644
--- a/tests/test_exceptions/test_httpexceptions.py
+++ b/tests/test_exceptions/test_httpexceptions.py
@@ -72,10 +72,10 @@ def test_redapp():
assert "text/html" == header_value(saved[0][1], 'content-type')
assert "/bing/foo" == header_value(saved[0][1],'location')
result = list(app({'HTTP_ACCEPT': 'text/plain'},saveit))
- print result[0] == (
+ print(result[0] == (
'302 Found\n'
'This resource was found at /bing/foo;\n'
- 'you should be redirected automatically.\n')
+ 'you should be redirected automatically.\n'))
assert "text/plain; charset=utf8" == header_value(saved[1][1],'content-type')
assert "/bing/foo" == header_value(saved[1][1],'location')
diff --git a/tests/test_exceptions/test_reporter.py b/tests/test_exceptions/test_reporter.py
index 8f4dc7a..a40666e 100644
--- a/tests/test_exceptions/test_reporter.py
+++ b/tests/test_exceptions/test_reporter.py
@@ -44,7 +44,7 @@ def test_logger():
assert 0
rep.report(exc_data)
content = open(fn).read()
- print content
+ print(content)
assert len(content.splitlines()) == 8
assert 'ZeroDivisionError' in content