Skip to content

Commit 280fbf6

Browse files
authored
TST: Replace parameterize with existing test fixture (pandas-dev#50350)
1 parent c49733c commit 280fbf6

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

pandas/tests/test_expressions.py

+3-14
Original file line numberDiff line numberDiff line change
@@ -237,35 +237,24 @@ def testit():
237237
expr.set_numexpr_threads()
238238
testit()
239239

240-
@pytest.mark.parametrize(
241-
"opname,op_str",
242-
[
243-
("gt", ">"),
244-
("lt", "<"),
245-
("ge", ">="),
246-
("le", "<="),
247-
("eq", "=="),
248-
("ne", "!="),
249-
],
250-
)
251240
@pytest.mark.parametrize(
252241
"left_fix,right_fix", [("_array", "_array2"), ("_array_mixed", "_array_mixed2")]
253242
)
254-
def test_comparison_ops(self, request, opname, op_str, left_fix, right_fix):
243+
def test_comparison_ops(self, request, comparison_op, left_fix, right_fix):
255244
left = request.getfixturevalue(left_fix)
256245
right = request.getfixturevalue(right_fix)
257246

258247
def testit():
259248
f12 = left + 1
260249
f22 = right + 1
261250

262-
op = getattr(operator, opname)
251+
op = comparison_op
263252

264253
result = expr.evaluate(op, left, f12, use_numexpr=True)
265254
expected = expr.evaluate(op, left, f12, use_numexpr=False)
266255
tm.assert_numpy_array_equal(result, expected)
267256

268-
result = expr._can_use_numexpr(op, op_str, right, f22, "evaluate")
257+
result = expr._can_use_numexpr(op, op, right, f22, "evaluate")
269258
assert not result
270259

271260
with option_context("compute.use_numexpr", False):

0 commit comments

Comments
 (0)