From c049099c838a45cc7dcae10228095b2341729250 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:08:49 -0800 Subject: [PATCH] Share fixture in expressions --- pandas/tests/test_expressions.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index 3980ec023960c..a627f3172f0c6 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -237,21 +237,10 @@ def testit(): expr.set_numexpr_threads() testit() - @pytest.mark.parametrize( - "opname,op_str", - [ - ("gt", ">"), - ("lt", "<"), - ("ge", ">="), - ("le", "<="), - ("eq", "=="), - ("ne", "!="), - ], - ) @pytest.mark.parametrize( "left_fix,right_fix", [("_array", "_array2"), ("_array_mixed", "_array_mixed2")] ) - def test_comparison_ops(self, request, opname, op_str, left_fix, right_fix): + def test_comparison_ops(self, request, comparison_op, left_fix, right_fix): left = request.getfixturevalue(left_fix) right = request.getfixturevalue(right_fix) @@ -259,13 +248,13 @@ def testit(): f12 = left + 1 f22 = right + 1 - op = getattr(operator, opname) + op = comparison_op result = expr.evaluate(op, left, f12, use_numexpr=True) expected = expr.evaluate(op, left, f12, use_numexpr=False) tm.assert_numpy_array_equal(result, expected) - result = expr._can_use_numexpr(op, op_str, right, f22, "evaluate") + result = expr._can_use_numexpr(op, op, right, f22, "evaluate") assert not result with option_context("compute.use_numexpr", False):