| import pytest | |
| from joblib._utils import eval_expr | |
| def test_eval_expr_invalid(expr): | |
| with pytest.raises(ValueError, match="is not a valid or supported arithmetic"): | |
| eval_expr(expr) | |
| def test_eval_expr_valid(expr, result): | |
| assert eval_expr(expr) == result | |