Skip to content

Commit

Permalink
add test for GH133
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Sep 22, 2024
1 parent fcb2a39 commit 3c55649
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_asteval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,18 @@ def test_no_duplicate_exception(nested):
assert len(interp.error) == 1
assert interp.error[0].exc == NameError

@pytest.mark.parametrize("nested", [False, True])
def test_raise_errors_unknown_symbol(nested):
""" test that raise_error raises corret error type. GH #133
"""
interp = make_interpreter(nested_symtable=nested)
try:
saw_exception = False
interp.run("unknown_value", with_raise=True)
except NameError:
saw_exception = True
assert saw_exception


@pytest.mark.parametrize("nested", [False, True])
def test_delete_slice(nested):
Expand Down

0 comments on commit 3c55649

Please sign in to comment.