| 218 | right = request.getfixturevalue(right_fix) |
| 219 | |
| 220 | def testit(left, right, opname, op_str): |
| 221 | if opname == "pow": |
| 222 | left = np.abs(left) |
| 223 | |
| 224 | op = getattr(operator, opname) |
| 225 | |
| 226 | # array has 0s |
| 227 | result = expr.evaluate(op, left, left, use_numexpr=True) |
| 228 | expected = expr.evaluate(op, left, left, use_numexpr=False) |
| 229 | tm.assert_numpy_array_equal(result, expected) |
| 230 | |
| 231 | result = expr._can_use_numexpr(op, op_str, right, right, "evaluate") |
| 232 | assert not result |
| 233 | |
| 234 | with option_context("compute.use_numexpr", False): |
| 235 | testit(left, right, opname, op_str) |