Pass all given kwargs to the ParserWrapper.

parent 07dc9e8d
...@@ -55,8 +55,8 @@ class ParserWrapper(object): ...@@ -55,8 +55,8 @@ class ParserWrapper(object):
self.input_buffer.append(input + '\n') self.input_buffer.append(input + '\n')
def run_expressions(base_class, expressions, keepfiles=1, fail=True, def run_expressions(base_class, expressions, fail=True, silent=False,
silent=False, verbose=0): **kwargs):
""" """
Run a list of mathematical expression through the term rewriting system and Run a list of mathematical expression through the term rewriting system and
check if the output matches the expected output. The list of EXPRESSIONS check if the output matches the expected output. The list of EXPRESSIONS
...@@ -76,7 +76,7 @@ def run_expressions(base_class, expressions, keepfiles=1, fail=True, ...@@ -76,7 +76,7 @@ def run_expressions(base_class, expressions, keepfiles=1, fail=True,
higher value will print more types of debug messages. higher value will print more types of debug messages.
""" """
parser = ParserWrapper(base_class, keepfiles=keepfiles, verbose=verbose) parser = ParserWrapper(base_class, **kwargs)
for exp, out in expressions: for exp, out in expressions:
res = None res = None
...@@ -85,7 +85,7 @@ def run_expressions(base_class, expressions, keepfiles=1, fail=True, ...@@ -85,7 +85,7 @@ def run_expressions(base_class, expressions, keepfiles=1, fail=True,
assert res == out assert res == out
except: # pragma: nocover except: # pragma: nocover
if not silent: if not silent:
print >>sys.stderr, 'error: %s = %s, but expected: %s' \ print >>sys.stderr, 'error: %s gives %s, but expected: %s' \
% (exp, str(res), str(out)) % (exp, str(res), str(out))
if not silent and hasattr(res, 'nodes'): if not silent and hasattr(res, 'nodes'):
......
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