summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-06-03 15:05:39 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-06-03 15:19:22 -0400
commite96afac261ce835a40680d0d4611626d5dee4cf9 (patch)
tree3d5064817cff1a1b263d09d6020178f4cf03d584 /test
parent9f23c60f6db9322311576e13e68d13ddccca38c9 (diff)
downloadmako-e96afac261ce835a40680d0d4611626d5dee4cf9.tar.gz
Remove all non-essential functions from _ast_util.py
As this is an old module that keeps changing with new Python releases, combined with the fact that we no longer use "import *", remove all unused functions from this module so that the list of imports we are maintaining is much shorter. Python 3.8 is also added to tox.ini with more adjustments to test_exceptions to accommodate for quoting differences. Fixes: #296 Change-Id: I0cea7d21ecb2be9335e0845ae7fbd06d468a137b
Diffstat (limited to 'test')
-rw-r--r--test/test_exceptions.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/test_exceptions.py b/test/test_exceptions.py
index c680591..c904d65 100644
--- a/test/test_exceptions.py
+++ b/test/test_exceptions.py
@@ -195,10 +195,15 @@ ${u'привет'}
html_error = exceptions.html_error_template().render()
if compat.py3k:
assert "RuntimeError: test" in html_error.decode("utf-8")
- assert "foo = u(&quot;日本&quot;)" in html_error.decode("utf-8")
+ assert "foo = u(&quot;日本&quot;)" in html_error.decode(
+ "utf-8"
+ ) or "foo = u(&#34;日本&#34;)" in html_error.decode("utf-8")
else:
assert "RuntimeError: test" in html_error
- assert "foo = u(&quot;&#x65E5;&#x672C;&quot;)" in html_error
+ assert (
+ "foo = u(&quot;&#x65E5;&#x672C;&quot;)" in html_error
+ or "foo = u(&#34;&#x65E5;&#x672C;&#34;)" in html_error
+ )
def test_py_unicode_error_html_error_template(self):
try:
@@ -328,7 +333,7 @@ ${foobar}
def test_custom_tback(self):
try:
raise RuntimeError("error 1")
- foo("bar") # noqa
+ foo("bar") # noqa
except:
t, v, tback = sys.exc_info()
@@ -341,7 +346,10 @@ ${foobar}
# obfuscate the text so that this text
# isn't in the 'wrong' exception
- assert "".join(reversed(");touq&rab;touq&(oof")) in html_error
+ assert (
+ "".join(reversed(");touq&rab;touq&(oof")) in html_error
+ or "".join(reversed(");43#&rab;43#&(oof")) in html_error
+ )
def test_tback_no_trace_from_py_file(self):
try: