From e96afac261ce835a40680d0d4611626d5dee4cf9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 3 Jun 2019 15:05:39 -0400 Subject: 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 --- test/test_exceptions.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'test') 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("日本")" in html_error.decode("utf-8") + assert "foo = u("日本")" in html_error.decode( + "utf-8" + ) or "foo = u("日本")" in html_error.decode("utf-8") else: assert "RuntimeError: test" in html_error - assert "foo = u("日本")" in html_error + assert ( + "foo = u("日本")" in html_error + or "foo = u("日本")" 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: -- cgit v1.2.1