Skip to content
Snippets Groups Projects
Commit 39a30ad5 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Catch division by zero in expression fuzzing test.

parent 00055efa
No related branches found
No related tags found
No related merge requests found
...@@ -467,7 +467,10 @@ def test_fuzz_code_generator(ctx_factory): ...@@ -467,7 +467,10 @@ def test_fuzz_code_generator(ctx_factory):
for expr, var_values in generate_random_fuzz_examples(50): for expr, var_values in generate_random_fuzz_examples(50):
#for expr, var_values in get_fuzz_examples(): #for expr, var_values in get_fuzz_examples():
from pymbolic import evaluate from pymbolic import evaluate
true_value = evaluate(expr, var_values) try:
true_value = evaluate(expr, var_values)
except ZeroDivisionError:
continue
def get_dtype(x): def get_dtype(x):
if isinstance(x, (complex, np.complexfloating)): if isinstance(x, (complex, np.complexfloating)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment