diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ast.py | 10 | ||||
-rw-r--r-- | Lib/test/test_compiler.py | 4 |
2 files changed, 5 insertions, 9 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index c702ab1..308ddae 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -144,13 +144,9 @@ def run_tests(): (eval_tests, eval_results, "eval")): for i, o in itertools.izip(input, output): ast_tree = compile(i, "?", kind, 0x400) - if to_tuple(ast_tree) != o: - print("i=", i) - print("o=", o) - print("kind=", kind) - print("tree=", ast_tree) - print("tuple=", to_tuple(ast_tree)) - assert to_tuple(ast_tree) == o + tup = to_tuple(ast_tree) + assert tup == o, ("kind=%r\ninput=%r\nexpected=%r\ngot=%r" % + (kind, i, o, tup)) test_order(ast_tree, (0, 0)) #### EVERYTHING BELOW IS GENERATED ##### diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py index 8535f42..4fb6cc1 100644 --- a/Lib/test/test_compiler.py +++ b/Lib/test/test_compiler.py @@ -50,8 +50,8 @@ class CompilerTest(unittest.TestCase): try: compiler.compile(buf, basename, "exec") except Exception as e: - args = list(e.args) - args[0] += "[in file %s]" % basename + args = list(e.args) or [""] + args[0] = "%s [in file %s]" % (args[0], basename) e.args = tuple(args) raise |