Commit 90939a9b authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #468 from rntz/master

minor tester & test fixes for python microrevision compatibility
parents 3808e4ea a9ffc453
s = """
def f():
a = 1
......@@ -11,7 +10,8 @@ f()
try:
exec s
except Exception as e:
print repr(e)
# avoid microrevision changes to Python error messages
print repr(e).replace("because ", "")
s = """
def f():
......@@ -27,4 +27,5 @@ f()
try:
exec s
except Exception as e:
print repr(e)
# avoid microrevision changes to Python error messages
print repr(e).replace("because ", "")
......@@ -208,6 +208,6 @@ for case in cases:
try:
exec case
except SyntaxError as se:
print se.message
print se.message.replace("because ", "")
# TODO uncomment this
# traceback.print_exc()
......@@ -125,6 +125,8 @@ def canonicalize_stderr(stderr):
("AttributeError: '(\w+)' object attribute '(\w+)' is read-only", "AttributeError: \\2"),
(r"TypeError: object.__new__\(\) takes no parameters", "TypeError: object() takes no parameters"),
("IndexError: list assignment index out of range", "IndexError: list index out of range"),
(r"unqualified exec is not allowed in function '(\w+)' it (.*)",
r"unqualified exec is not allowed in function '\1' because it \2"),
]
for pattern, subst_with in substitutions:
......@@ -206,9 +208,6 @@ def get_test_options(fn, check_stats, run_memcheck):
elif os.path.basename(fn).split('.')[0] in TESTS_TO_SKIP:
opts.skip = 'command line option'
if opts.collect_stats:
opts.jit_args = ['-s'] + opts.jit_args
assert opts.expected in ("success", "fail", "statfail"), opts.expected
if TEST_PYPY:
......@@ -217,6 +216,9 @@ def get_test_options(fn, check_stats, run_memcheck):
opts.check_stats = False
opts.expected = "success"
if opts.collect_stats:
opts.jit_args = ['-s'] + opts.jit_args
return opts
def determine_test_result(fn, opts, code, out, stderr, elapsed):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment