aboutsummaryrefslogtreecommitdiffstats
path: root/test/__init__.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-11-11 14:38:56 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-11-11 14:38:56 -0500
commit1eb56ef02a7fa825be99ddfb95f217a07dab1cdf (patch)
treebf0857b7f42dec7db03910799eed7e5dda5e7c2b /test/__init__.py
parent4ab9664a515c265238d420b0373f7225fe2e53c7 (diff)
downloadexternal_python_mako-1eb56ef02a7fa825be99ddfb95f217a07dab1cdf.tar.gz
external_python_mako-1eb56ef02a7fa825be99ddfb95f217a07dab1cdf.tar.bz2
external_python_mako-1eb56ef02a7fa825be99ddfb95f217a07dab1cdf.zip
- first pass at running a py3k compatible base in py2k as well.
having some weird unicode issues I can't debug; the meaning of str.encode() seems to be changing globally somehow
Diffstat (limited to 'test/__init__.py')
-rw-r--r--test/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/__init__.py b/test/__init__.py
index ded1a5d..c983c5d 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -1,6 +1,7 @@
from mako.template import Template
-import unittest, os
-from mako.util import py3k, py26, py25
+import unittest
+import os
+from mako.compat import py3k, py26, py25
from mako.util import function_named
import re
from mako.cache import CacheImpl, register_plugin
@@ -64,7 +65,7 @@ def assert_raises(except_cls, callable_, *args, **kw):
try:
callable_(*args, **kw)
success = False
- except except_cls, e:
+ except except_cls as e:
success = True
# assert outside the block so it works for AssertionError too !
@@ -74,9 +75,9 @@ def assert_raises_message(except_cls, msg, callable_, *args, **kwargs):
try:
callable_(*args, **kwargs)
assert False, "Callable did not raise an exception"
- except except_cls, e:
+ except except_cls as e:
assert re.search(msg, str(e)), "%r !~ %s" % (msg, e)
- print str(e)
+ print(str(e))
def skip_if(predicate, reason=None):
"""Skip a test if predicate is true."""