Skip to content
Snippets Groups Projects
Commit a6373f5b authored by Joseph Weston's avatar Joseph Weston
Browse files

check for warning when a sympy expression is passed to 'lambdify'

parent baff68bb
Branches
Tags
No related merge requests found
......@@ -185,5 +185,12 @@ def test_lambdify_substitutions(e, kwargs):
should_be = lambda x, y, z: x + y + z
subs = {'y': 'y + z'}
e = lambdify(e, locals=subs)
if not isinstance(e, str):
# warns that 'locals' are not used if 'e' is
# a sympy expression already
with pytest.warns(RuntimeWarning):
e = lambdify(e, locals=subs)
else:
e = lambdify(e, locals=subs)
assert e(**kwargs) == should_be(**kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment